Parametrize port and base_url
This commit is contained in:
parent
3d41e28342
commit
95de4e7477
@ -9,3 +9,11 @@ rendered front-end.
|
|||||||
npm install
|
npm install
|
||||||
npm run watch
|
npm run watch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Running on a custom port
|
||||||
|
|
||||||
|
```
|
||||||
|
export SEALIOUS_PORT=8888
|
||||||
|
export SEALIOUS_BASE_URL="https://888.dep.sealcode.org"
|
||||||
|
npm run watch
|
||||||
|
```
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
"build": "npm run build:back && npm run build:front",
|
"build": "npm run build:back && npm run build:front",
|
||||||
"watch:back": "tsc --watch -p src/back",
|
"watch:back": "tsc --watch -p src/back",
|
||||||
"watch:front": "webpack --watch",
|
"watch:front": "webpack --watch",
|
||||||
"watch": "tmux new-session -d \"printf '\\033]2;%s\\033\\' 'watch:back' && npm run watch:back\" && tmux split-window -d \"printf '\\033]2;%s\\033\\' 'server' && nodemon .\" && tmux split-window -d \"printf '\\033]2;%s\\033\\' 'watch:front' && npm run watch:front\" && tmux select-layout even-horizontal && tmux set -g pane-border-status top && tmux attach",
|
"watch": "tmux new-session -d \"printf '\\033]2;%s\\033\\' 'watch:back' && npm run watch:back\" && tmux split-window -d \"printf '\\033]2;%s\\033\\' 'server' && SEALIOUS_PORT=$SEALIOUS_PORT SEALIOUS_BASE_URL=$SEALIOUS_BASE_URL nodemon .\" && tmux split-window -d \"printf '\\033]2;%s\\033\\' 'watch:front' && npm run watch:front\" && tmux select-layout even-horizontal && tmux set -g pane-border-status top && tmux attach",
|
||||||
"test-reports": "npm run build && rm -fr .xunit coverage && docker-compose up -d db mailcatcher && npm run test -- --cover --test-report",
|
"test-reports": "npm run build && rm -fr .xunit coverage && docker-compose up -d db mailcatcher && npm run test -- --cover --test-report",
|
||||||
"cover-html": "npm run test-reports -- --cover-html && xdg-open coverage/lcov-report/index.html"
|
"cover-html": "npm run test-reports -- --cover-html && xdg-open coverage/lcov-report/index.html"
|
||||||
},
|
},
|
||||||
|
@ -4,6 +4,13 @@ import { App } from "sealious";
|
|||||||
import tasks from "./collections/tasks";
|
import tasks from "./collections/tasks";
|
||||||
const locreq = _locreq(__dirname);
|
const locreq = _locreq(__dirname);
|
||||||
|
|
||||||
|
const PORT = process.env.SEALIOUS_PORT
|
||||||
|
? parseInt(process.env.SEALIOUS_PORT)
|
||||||
|
: 8080;
|
||||||
|
const base_url = process.env.SEALIOUS_BASE_URL || `http://localhost:${PORT}`;
|
||||||
|
|
||||||
|
console.log(process.env);
|
||||||
|
|
||||||
export default class TheApp extends App {
|
export default class TheApp extends App {
|
||||||
config = {
|
config = {
|
||||||
upload_path: locreq.resolve("uploaded_files"),
|
upload_path: locreq.resolve("uploaded_files"),
|
||||||
@ -19,13 +26,16 @@ export default class TheApp extends App {
|
|||||||
logger: {
|
logger: {
|
||||||
level: <const>"info",
|
level: <const>"info",
|
||||||
},
|
},
|
||||||
|
"www-server": {
|
||||||
|
port: PORT,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
manifest = {
|
manifest = {
|
||||||
name: "Sealious Playground",
|
name: "Sealious Playground",
|
||||||
logo: resolve(__dirname, "../assets/logo.png"),
|
logo: resolve(__dirname, "../assets/logo.png"),
|
||||||
version: "0.0.1",
|
version: "0.0.1",
|
||||||
default_language: "en",
|
default_language: "en",
|
||||||
base_url: "localhost:8080",
|
base_url,
|
||||||
admin_email: "admin@example.com",
|
admin_email: "admin@example.com",
|
||||||
colors: {
|
colors: {
|
||||||
primary: "#5294a1",
|
primary: "#5294a1",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user