Initial nginx config generation, can use environment variabes PORT and SERVER_NAME. Dynamically figures out static regex based on build directory

This commit is contained in:
Colby Gutierrez-Kraybill 2015-09-16 15:09:15 -04:00
parent df1c214a01
commit 1cf6cedaee
3 changed files with 10 additions and 1 deletions

View file

@ -17,6 +17,10 @@ clean:
static:
cp -a ./static/. ./build/
nginx_conf:
@make static
node server/nginx.js
webpack:
$(WEBPACK)

View file

@ -41,7 +41,7 @@
"react-modal": "0.3.0",
"react-onclickoutside": "0.3.1",
"react-slick": "0.7.0",
"routes-to-nginx-conf": "0.0.2",
"routes-to-nginx-conf": "0.0.4",
"sass-loader": "2.0.1",
"slick-carousel": "1.5.8",
"style-loader": "0.12.3",

5
server/nginx.js Normal file
View file

@ -0,0 +1,5 @@
var routes = require('./routes.json');
var nginx_conf = require('routes-to-nginx-conf');
nginx_conf.generate_nginx_conf( routes, function(v) { console.log(v) } );