taco-nginx

Bash script that runs a service and forwards a subdomain to it using nginx when it listens to $PORT

  • 所有者: mafintosh/taco-nginx
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

taco-nginx

Bash script that runs a service and forwards a subdomain to it using nginx when it listens to $PORT

npm install -g taco-nginx

We recommend using latest stable nginx (>1.8.0). If you are on Ubuntu LTS for example you may need to do this:

add-apt-repository ppa:nginx/stable
apt-get update
apt-get install nginx

Usage

First write a service (in any language) similar to this

var http = require('http')
var server = http.createServer(function (req, res) {
  console.log('Got request!', req.url)
  res.end('hello world\n')
})

server.listen(process.env.PORT, function () {
  console.log('Server is listening...')
})

Assuming the above file is called server.js and you have nginx running you can now do

taco-nginx --name my-service node server.js

taco-nginx will now spawn node server.js, wait for it to listen to the port specified in
$PORT and then have nginx route requests to my-service.* to it.

If you don't specify --name it will see if you have a package.json and use the name field

taco-nginx node server.js # uses name from package.json

For a full list of options run

taco-nginx --help

License

MIT

主要指标

概览
名称与所有者mafintosh/taco-nginx
主编程语言Shell
编程语言Shell (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2015-04-19 19:38:43
推送于2019-01-26 16:21:01
最后一次提交2019-01-26 17:20:52
发布数23
最新版本名称v1.12.1 (发布于 2019-01-26 17:20:52)
第一版名称v1.0.0 (发布于 2015-04-19 12:45:33)
用户参与
星数101
关注者数4
派生数4
提交数56
已启用问题?
问题数5
打开的问题数2
拉请求数2
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?