Compare commits

...

9 commits

6 changed files with 733 additions and 70 deletions

19
.vscode/launch.json vendored
View file

@ -1,19 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Website in Chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/packages/game/lib/static",
"preLaunchTask": "Build",
"pathMapping": {
"/": "${workspaceFolder}/packages/game/src"
}
}
]
}

View file

@ -23,7 +23,8 @@
"html.format.extraLiners": "",
"html.format.indentInnerHtml": true,
"html.format.maxPreserveNewLines": 1,
"html.format.wrapAttributes": "preserve-aligned"
"html.format.wrapAttributes": "preserve-aligned",
"npm.packageManager": "npm"
},
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
@ -32,8 +33,15 @@
"tasks": [
{
"label": "Build",
"type": "npm",
"script": "watch",
"type": "shell",
"options": {
"cwd": "${workspaceFolder:Solution Items}"
},
"command": "npm",
"args": [
"run",
"watch"
],
"group": {
"kind": "build",
"isDefault": true
@ -62,8 +70,15 @@
},
{
"label": "Rebuild",
"type": "npm",
"script": "rebuild",
"type": "shell",
"options": {
"cwd": "${workspaceFolder:Solution Items}"
},
"command": "npm",
"args": [
"run",
"rebuild"
],
"problemMatcher": [],
"presentation": {
"reveal": "never"
@ -71,8 +86,15 @@
},
{
"label": "Lint",
"type": "npm",
"script": "lint-ide",
"type": "shell",
"options": {
"cwd": "${workspaceFolder:Solution Items}"
},
"command": "npm",
"args": [
"run",
"lint-ide"
],
"problemMatcher": "$eslint-stylish",
"presentation": {
"reveal": "never"
@ -95,10 +117,31 @@
"preLaunchTask": "Build",
"pathMapping": {
"/": "${workspaceFolder:ConnectForce}/src"
},
"presentation": {
"hidden": true
}
},
{
"type": "node",
"request": "launch",
"name": "Launch Server",
"program": "${workspaceFolder:Server}/src/main.js",
"console": "integratedTerminal",
"presentation": {
"hidden": true
}
}
],
"compounds": []
"compounds": [
{
"name": "Launch Project in Chrome",
"configurations": [
"Launch Website in Chrome",
"Launch Server"
]
}
]
},
"extensions": {
"recommendations": [

693
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -9,7 +9,7 @@
},
"scripts": {
"rebuild": "npm run --workspaces rebuild",
"watch": "npm run --workspaces watch",
"watch": "concurrently --raw \"npm run --workspaces --if-present watch\"",
"clean": "npm run --workspaces clean",
"lint-local": "eslint --max-warnings 0 .eslintrc.cjs",
"lint-local-ide": "npm run lint-local || exit 0",
@ -20,6 +20,7 @@
},
"devDependencies": {
"@manuth/eslint-plugin-typescript": "^4.0.1",
"concurrently": "^7.6.0",
"eslint": "^8.29.0"
}
}

View file

@ -5,5 +5,13 @@
"description": "A server for Storing ConnectForce Savegames",
"author": "Manuel Thalmann <m@nuth.ch>",
"scripts": {
"start": "noderel -e ./src/main.js"
},
"dependencies": {
"express": "^4.18.2"
},
"devDependencies": {
"@types/express": "^4.17.15",
"noderel": "^1.0.13"
}
}

View file

@ -0,0 +1,21 @@
import express from "express";
const app = express();
app.use(
(request, response, next) =>
{
response.send("Hello World");
response.status(100);
});
app.use(
[
(error, request, response, next) =>
{
response.send(`${error}`);
response.status(error?.status ?? 500);
}
]);
app.listen(1337);