fix: fix port not defaulting to 4002, add server.js (#976)

fixes #972
pull/977/head
Nolan Lawson 2019-02-12 23:12:50 -08:00 zatwierdzone przez GitHub
rodzic f6e9d714d3
commit 2adf8a738e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 8 dodań i 3 usunięć

Wyświetl plik

@ -22,4 +22,4 @@ EXPOSE 4002
# Setting run-command, using explicit `node` command
# rather than `yarn` or `npm` to use less memory
# https://github.com/nolanlawson/pinafore/issues/971
CMD PORT=4002 node __sapper__/build
CMD PORT=4002 node server.js

Wyświetl plik

@ -64,7 +64,7 @@ Then build:
Then run:
PORT=4002 node __sapper__/build
PORT=4002 node server.js
### Docker

Wyświetl plik

@ -12,7 +12,7 @@
"build": "cross-env NODE_ENV=production run-s build-steps",
"build-steps": "run-s before-build sapper-build",
"sapper-build": "sapper build",
"start": "PORT=4002 node __sapper__/build",
"start": "node server.js",
"build-and-start": "run-s build start",
"build-template-html": "node -r esm ./bin/build-template-html.js",
"build-template-html-watch": "node -r esm ./bin/build-template-html.js --watch",

5
server.js 100755
Wyświetl plik

@ -0,0 +1,5 @@
#!/usr/bin/env node
process.env.PORT = process.env.PORT || 4002
require('./__sapper__/build')