Parametrize port and base_url
This commit is contained in:
parent
3d41e28342
commit
95de4e7477
@ -9,3 +9,11 @@ rendered front-end.
|
||||
npm install
|
||||
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",
|
||||
"watch:back": "tsc --watch -p src/back",
|
||||
"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",
|
||||
"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";
|
||||
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 {
|
||||
config = {
|
||||
upload_path: locreq.resolve("uploaded_files"),
|
||||
@ -19,13 +26,16 @@ export default class TheApp extends App {
|
||||
logger: {
|
||||
level: <const>"info",
|
||||
},
|
||||
"www-server": {
|
||||
port: PORT,
|
||||
},
|
||||
};
|
||||
manifest = {
|
||||
name: "Sealious Playground",
|
||||
logo: resolve(__dirname, "../assets/logo.png"),
|
||||
version: "0.0.1",
|
||||
default_language: "en",
|
||||
base_url: "localhost:8080",
|
||||
base_url,
|
||||
admin_email: "admin@example.com",
|
||||
colors: {
|
||||
primary: "#5294a1",
|
||||
|
Loading…
x
Reference in New Issue
Block a user