1. 首页
  2. 考试认证
  3. 其它
  4. the metal关于Rack 2.0的想法

the metal关于Rack 2.0的想法

上传者: 2024-12-09 19:39:46上传 ZIP文件 12.96KB 热度 3次

the_metal 描述:研究 Rack 2.0 的高峰特点/问题:完全是实验性的。这只是一个尖峰。

概要:没有任何中间件的应用程序:


gem 'the_metal', github: 'tenderlove/the_metal'

require 'the_metal/puma'

TheMetal.create_server(->(req, res) {

  res.write_head 200, 'Content-Type' => 'text/plain'

  res.write 'Hello World'

  res.finish

})

.listen 9292, '0.0.0.0'

你也可以使用一个类:


class Application

  def call(req, res)

    res.write_head 200, 'Content-Type' => 'text/plain'

    res.write 'Hello World'

    res.finish

  end

end

下载地址
用户评论