Separated frontend and backend, created basic dev environment and websocket server
This commit is contained in:
parent
df2873dc48
commit
7fff6d4006
6
back/nodemon.json
Normal file
6
back/nodemon.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"watch": ["src/"],
|
||||||
|
"ext": "ts,json",
|
||||||
|
"exec": "etsc && node ./dist/index.js",
|
||||||
|
"legacyWatch": true
|
||||||
|
}
|
26
back/package.json
Normal file
26
back/package.json
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"name": "roomruler",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Web application for distribution of free classrooms",
|
||||||
|
"scripts": {
|
||||||
|
"build": "esbuild src/index.ts --bundle --minify --outdir=dist --platform=node",
|
||||||
|
"start": "esbuild",
|
||||||
|
"dev": "nodemon"
|
||||||
|
},
|
||||||
|
"author": "dm1sh",
|
||||||
|
"license": "MIT",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/ws": "^7.4.7",
|
||||||
|
"esbuild": "^0.12.25",
|
||||||
|
"esbuild-envfile-plugin": "^1.0.1",
|
||||||
|
"esbuild-node-tsc": "^1.6.1",
|
||||||
|
"nodemon": "^2.0.12",
|
||||||
|
"typescript": "^4.4.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"pg": "^8.7.1",
|
||||||
|
"reflect-metadata": "^0.1.13",
|
||||||
|
"typeorm": "^0.2.37",
|
||||||
|
"ws": "^8.2.1"
|
||||||
|
}
|
||||||
|
}
|
12
back/src/index.ts
Normal file
12
back/src/index.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import "reflect-metadata";
|
||||||
|
import { Server } from "ws";
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
const wss = new Server({
|
||||||
|
port: Number.parseInt(process.env.PORT || "") || 8081,
|
||||||
|
});
|
||||||
|
|
||||||
|
wss.on("connection", async (ws) => {
|
||||||
|
ws.send("hello");
|
||||||
|
});
|
||||||
|
})();
|
14
back/tsconfig.json
Normal file
14
back/tsconfig.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es6",
|
||||||
|
"module": "commonjs",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"strict": false,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"outDir": "dist"
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user