dev environment

This commit is contained in:
cupcakearmy
2019-05-23 13:19:42 +02:00
parent fe8a1c8412
commit dd405d11ac
5 changed files with 20 additions and 18 deletions

View File

@@ -1,12 +1,10 @@
{
"private": true,
"assets": [
".next/**/*"
],
"scripts": {
"dev": "npm i && node server.js",
"prod": "NODE_ENV=production node server.js",
"build": "next build"
"build": "next build",
"dev": "npm install --silent && node server.js",
"dev:local": "npm install --silent && API_HOST=localhost node server.js",
"prod": "NODE_ENV=production node server.js"
},
"dependencies": {
"axios": "^0.18.0",

View File

@@ -12,7 +12,9 @@ const app = next({ dev })
const handle = app.getRequestHandler()
const proxy = httpProxy.createProxyServer()
const target = 'http://api'
const target = dev
? `http://${process.env.API_HOST || 'api'}:5000`
: 'http://api'
app.prepare().then(() => {