taco-nginx

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

  • Owner: mafintosh/taco-nginx
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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

Main metrics

Overview
Name With Ownermafintosh/taco-nginx
Primary LanguageShell
Program languageShell (Language Count: 1)
Platform
License:MIT License
所有者活动
Created At2015-04-19 19:38:43
Pushed At2019-01-26 16:21:01
Last Commit At2019-01-26 17:20:52
Release Count23
Last Release Namev1.12.1 (Posted on 2019-01-26 17:20:52)
First Release Namev1.0.0 (Posted on 2015-04-19 12:45:33)
用户参与
Stargazers Count101
Watchers Count4
Fork Count4
Commits Count56
Has Issues Enabled
Issues Count5
Issue Open Count2
Pull Requests Count2
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private