diff --git a/config/default.ts b/config/default.ts index 6b0727d..731014e 100644 --- a/config/default.ts +++ b/config/default.ts @@ -1,2 +1,43 @@ export default Object.assign(require("wms-core/config/default").default, { + app: { + name: 'Example App', + contact_email: 'noreply@example.net' + }, + log_level: "DEV", + db_log_level: "ERROR", + public_url: "http://localhost:4899", + public_websocket_url: "ws://localhost:4899", + port: 4899, + gitlab_webhook_token: 'secret', + mysql: { + connectionLimit: 10, + host: "localhost", + user: "root", + password: "", + database: "wms2", + create_database_automatically: false + }, + redis: { + host: "127.0.0.1", + port: 6379, + prefix: 'wms' + }, + session: { + secret: "very_secret_not_known", + cookie: { + secure: false + } + }, + mail: { + host: "127.0.0.1", + port: "1025", + secure: false, + username: "", + password: "", + allow_invalid_tls: true + }, + view: { + cache: false + }, + approval_mode: false, }); \ No newline at end of file diff --git a/config/production.ts b/config/production.ts index 7765a4f..d3ba121 100644 --- a/config/production.ts +++ b/config/production.ts @@ -1,2 +1,15 @@ export default Object.assign(require("wms-core/config/production").default, { + log_level: "DEBUG", + db_log_level: "ERROR", + public_url: "https://watch-my.stream", + public_websocket_url: "wss://watch-my.stream", + session: { + cookie: { + secure: true + } + }, + mail: { + secure: true, + allow_invalid_tls: false + } }); \ No newline at end of file diff --git a/config/test.ts b/config/test.ts index 37855e8..149ace2 100644 --- a/config/test.ts +++ b/config/test.ts @@ -1,2 +1,9 @@ export default Object.assign(require("wms-core/config/test").default, { + mysql: { + host: "localhost", + user: "root", + password: "", + database: "wms2_test", + create_database_automatically: true + } }); \ No newline at end of file diff --git a/package.json b/package.json index 4e6ce8f..1ae5253 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "aldap", + "name": "Example App", "version": "0.1.0", - "description": "Authentication LDAP server", - "repository": "git@gitlab.com:ArisuOngaku/aldap.git", + "description": "Example App based on wms-core", + "repository": "git@gitlab.com:ArisuOngaku/wms-boilerplate.git", "author": "Alice Gaudon ", "private": true, "main": "dist/main.js", diff --git a/src/ExampleApp.ts b/src/App.ts similarity index 98% rename from src/ExampleApp.ts rename to src/App.ts index 3fb414c..713f51b 100644 --- a/src/ExampleApp.ts +++ b/src/App.ts @@ -19,7 +19,7 @@ import WebSocketServerComponent from "wms-core/components/WebSocketServerCompone import HomeController from "./controllers/HomeController"; import AutoUpdateComponent from "wms-core/components/AutoUpdateComponent"; -export default class ExampleApp extends Application { +export default class App extends Application { private readonly port: number; constructor(port: number) { diff --git a/src/main.ts b/src/main.ts index 4a9b34b..1706351 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,9 @@ import Logger from "wms-core/Logger"; -import ExampleApp from "./ExampleApp"; +import App from "./App"; +import config from "config"; (async () => { - const app = new ExampleApp(4899); + const app = new App(config.get('port')); await app.start(); })().catch(err => { Logger.error(err); diff --git a/views/about.njk b/views/about.njk index 08342ae..dbb6047 100644 --- a/views/about.njk +++ b/views/about.njk @@ -1,6 +1,6 @@ {% extends 'layouts/base.njk' %} -{% set title = 'Example App - About us' %} +{% set title = app.name + ' - About us' %} {% block body %}

Very interesting

diff --git a/views/errors/error.njk b/views/errors/error.njk index 3e0236a..3d05ea9 100644 --- a/views/errors/error.njk +++ b/views/errors/error.njk @@ -7,7 +7,7 @@ {% endblock %} {% block _body %} - +
{% if flash %} @@ -31,6 +31,6 @@ Error ID: {{ error_id }}
If you think this isn't right, please contact us with the above error ID at - contact@example.net. + {{ app.contact_email }}. {% endblock %} \ No newline at end of file diff --git a/views/home.njk b/views/home.njk index 1afefb7..09adf33 100644 --- a/views/home.njk +++ b/views/home.njk @@ -1,6 +1,6 @@ {% extends 'layouts/base.njk' %} -{% set title = 'Example App - Hello world!' %} +{% set title = app.name + ' - Hello world!' %} {% block body %}

Hello world!

diff --git a/views/layouts/base.njk b/views/layouts/base.njk index 36e5e8d..97f72d7 100644 --- a/views/layouts/base.njk +++ b/views/layouts/base.njk @@ -12,7 +12,7 @@ {% endblock %} {% block header %} - +
{% endblock %} -{% block footer %}Example app v{{ app_version }} - all rights reserved.{% endblock %} \ No newline at end of file +{% block footer %}{{ app.name }} v{{ app_version }} - all rights reserved.{% endblock %} \ No newline at end of file