swaf rename: rename project to swaf-boilerplate
This commit is contained in:
parent
f16d63c74f
commit
ba5b90a4f9
@ -0,0 +1,3 @@
|
|||||||
|
# swaf boilerplate
|
||||||
|
|
||||||
|
Boilerplate for a quickstart with [swaf](https://eternae.ink/arisu/swaf)
|
11
app.service
11
app.service
@ -1,13 +1,16 @@
|
|||||||
|
# Please customize values i.e. paths, user, group, WorkingDirectory based on your environment. Do not use the same
|
||||||
|
# user and group for different applications.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=WMS website
|
Description=swaf based website
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=wms
|
User=swaf
|
||||||
Group=wms
|
Group=swaf
|
||||||
WorkingDirectory=/home/wms/live
|
WorkingDirectory=/home/swaf/live
|
||||||
Restart=on-success
|
Restart=on-success
|
||||||
Environment=NODE_ENV=production
|
Environment=NODE_ENV=production
|
||||||
ExecStart=/bin/node .
|
ExecStart=/bin/node .
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
id="svg6"
|
id="svg6"
|
||||||
sodipodi:docname="logo.svg"
|
sodipodi:docname="logo.svg"
|
||||||
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
|
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
|
||||||
inkscape:export-filename="/r/arisu/dev/streams/wms/assets/img/logox1024.png"
|
|
||||||
inkscape:export-xdpi="4096"
|
inkscape:export-xdpi="4096"
|
||||||
inkscape:export-ydpi="4096">
|
inkscape:export-ydpi="4096">
|
||||||
<metadata
|
<metadata
|
||||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* For labels to update their state (css selectors based on the value attribute)
|
* For labels to update their state (css selectors based on the value attribute)
|
||||||
*/
|
*/
|
||||||
import {ValidationError} from "wms-core/db/Validator";
|
import {ValidationError} from "swaf/db/Validator";
|
||||||
|
|
||||||
export function updateInputs(): void {
|
export function updateInputs(): void {
|
||||||
document.querySelectorAll<HTMLInputElement | HTMLTextAreaElement>('input, textarea').forEach(el => {
|
document.querySelectorAll<HTMLInputElement | HTMLTextAreaElement>('input, textarea').forEach(el => {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
host: "localhost",
|
host: "localhost",
|
||||||
user: "root",
|
user: "root",
|
||||||
password: "",
|
password: "",
|
||||||
database: "wms2_test",
|
database: "swaf_test",
|
||||||
create_database_automatically: true
|
create_database_automatically: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "example-app",
|
"name": "example-app",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"description": "Example App based on wms-core",
|
"description": "Example App based on swaf",
|
||||||
"repository": "https://gitlab.com/ArisuOngaku/wms-boilerplate",
|
"repository": "https://eternae.ink/arisu/swaf-boilerplate",
|
||||||
"author": "Alice Gaudon <alice@gaudon.pro>",
|
"author": "Alice Gaudon <alice@gaudon.pro>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "dist/src/main.js",
|
"main": "dist/src/main.js",
|
||||||
@ -60,6 +60,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"config": "^3.3.1",
|
"config": "^3.3.1",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"wms-core": "^0.22.0"
|
"swaf": "^0.22.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
38
src/App.ts
38
src/App.ts
@ -1,24 +1,24 @@
|
|||||||
import Application from "wms-core/Application";
|
import Application from "swaf/Application";
|
||||||
import Migration, {MigrationType} from "wms-core/db/Migration";
|
import Migration, {MigrationType} from "swaf/db/Migration";
|
||||||
import CreateMigrationsTable from "wms-core/migrations/CreateMigrationsTable";
|
import CreateMigrationsTable from "swaf/migrations/CreateMigrationsTable";
|
||||||
import ExpressAppComponent from "wms-core/components/ExpressAppComponent";
|
import ExpressAppComponent from "swaf/components/ExpressAppComponent";
|
||||||
import NunjucksComponent from "wms-core/components/NunjucksComponent";
|
import NunjucksComponent from "swaf/components/NunjucksComponent";
|
||||||
import MysqlComponent from "wms-core/components/MysqlComponent";
|
import MysqlComponent from "swaf/components/MysqlComponent";
|
||||||
import LogRequestsComponent from "wms-core/components/LogRequestsComponent";
|
import LogRequestsComponent from "swaf/components/LogRequestsComponent";
|
||||||
import RedisComponent from "wms-core/components/RedisComponent";
|
import RedisComponent from "swaf/components/RedisComponent";
|
||||||
import ServeStaticDirectoryComponent from "wms-core/components/ServeStaticDirectoryComponent";
|
import ServeStaticDirectoryComponent from "swaf/components/ServeStaticDirectoryComponent";
|
||||||
import MaintenanceComponent from "wms-core/components/MaintenanceComponent";
|
import MaintenanceComponent from "swaf/components/MaintenanceComponent";
|
||||||
import MailComponent from "wms-core/components/MailComponent";
|
import MailComponent from "swaf/components/MailComponent";
|
||||||
import SessionComponent from "wms-core/components/SessionComponent";
|
import SessionComponent from "swaf/components/SessionComponent";
|
||||||
import RedirectBackComponent from "wms-core/components/RedirectBackComponent";
|
import RedirectBackComponent from "swaf/components/RedirectBackComponent";
|
||||||
import FormHelperComponent from "wms-core/components/FormHelperComponent";
|
import FormHelperComponent from "swaf/components/FormHelperComponent";
|
||||||
import CsrfProtectionComponent from "wms-core/components/CsrfProtectionComponent";
|
import CsrfProtectionComponent from "swaf/components/CsrfProtectionComponent";
|
||||||
import WebSocketServerComponent from "wms-core/components/WebSocketServerComponent";
|
import WebSocketServerComponent from "swaf/components/WebSocketServerComponent";
|
||||||
import HomeController from "./controllers/HomeController";
|
import HomeController from "./controllers/HomeController";
|
||||||
import AutoUpdateComponent from "wms-core/components/AutoUpdateComponent";
|
import AutoUpdateComponent from "swaf/components/AutoUpdateComponent";
|
||||||
import packageJson = require('../package.json');
|
import packageJson = require('../package.json');
|
||||||
import DummyMigration from "wms-core/migrations/DummyMigration";
|
import DummyMigration from "swaf/migrations/DummyMigration";
|
||||||
import DropLegacyLogsTable from "wms-core/migrations/DropLegacyLogsTable";
|
import DropLegacyLogsTable from "swaf/migrations/DropLegacyLogsTable";
|
||||||
|
|
||||||
export default class App extends Application {
|
export default class App extends Application {
|
||||||
public constructor(
|
public constructor(
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import Controller from "wms-core/Controller";
|
import Controller from "swaf/Controller";
|
||||||
import {Request, Response} from "express";
|
import {Request, Response} from "express";
|
||||||
|
|
||||||
export default class HomeController extends Controller {
|
export default class HomeController extends Controller {
|
||||||
@ -17,7 +17,7 @@ export default class HomeController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is to test and assert that wms-core extended types are available
|
* This is to test and assert that swaf extended types are available
|
||||||
*/
|
*/
|
||||||
protected async goBack(req: Request, res: Response): Promise<void> {
|
protected async goBack(req: Request, res: Response): Promise<void> {
|
||||||
res.redirectBack();
|
res.redirectBack();
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import {delimiter} from "path";
|
import {delimiter} from "path";
|
||||||
|
|
||||||
// Load config from specified path or default + wms-core/config (default defaults)
|
// Load config from specified path or default + swaf/config (default defaults)
|
||||||
process.env['NODE_CONFIG_DIR'] =
|
process.env['NODE_CONFIG_DIR'] =
|
||||||
__dirname + '/../../node_modules/wms-core/config/'
|
__dirname + '/../../node_modules/swaf/config/'
|
||||||
+ delimiter
|
+ delimiter
|
||||||
+ (process.env['NODE_CONFIG_DIR'] || __dirname + '/../../config/');
|
+ (process.env['NODE_CONFIG_DIR'] || __dirname + '/../../config/');
|
||||||
|
|
||||||
import {log} from "wms-core/Logger";
|
import {log} from "swaf/Logger";
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
import config from "config";
|
import config from "config";
|
||||||
|
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
"node_modules/wms-core/types"
|
"node_modules/swaf/types"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<section class="panel">
|
<section class="panel">
|
||||||
<h2>This is us</h2>
|
<h2>This is us</h2>
|
||||||
<p class="center">And we like wms!</p>
|
<p class="center">And we like swaf!</p>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user