Converted game server to typescript
This commit is contained in:
parent
35f470d6e2
commit
375b87ce0f
14
apps/server/.eslintrc.js
Normal file
14
apps/server/.eslintrc.js
Normal file
@ -0,0 +1,14 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
es2021: true,
|
||||
node: true,
|
||||
},
|
||||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: 13,
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['@typescript-eslint'],
|
||||
rules: {},
|
||||
}
|
@ -3,14 +3,22 @@
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"dev": "nodemon server.js",
|
||||
"start": "node server.js"
|
||||
"dev": "nodemon src/server.ts",
|
||||
"start": "tsc && node dist/server.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"express":"^4.18.2",
|
||||
"socket.io":"^4.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon":"^2.0.21"
|
||||
"nodemon":"^2.0.21",
|
||||
"@typescript-eslint/eslint-plugin": "^5.43.0",
|
||||
"eslint": "^8.28.0",
|
||||
"eslint-config-standard-with-typescript": "^23.0.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-n": "^15.5.1",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"typescript": "^4.9.3",
|
||||
"ts-node":"^10.9.1"
|
||||
}
|
||||
}
|
@ -9,11 +9,11 @@ const io = new Server(server, {
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
app.get('/', (req: any, res: any) => {
|
||||
res.send('<h1>Quippy Server</h1>');
|
||||
});
|
||||
|
||||
io.on('connection', (socket) => {
|
||||
io.on('connection', (socket: any) => {
|
||||
console.log("SocketIO connected to a user.")
|
||||
})
|
||||
|
12
apps/server/tsconfig.json
Normal file
12
apps/server/tsconfig.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"target": "es6",
|
||||
"strict": true,
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": true,
|
||||
"outDir": "dist"
|
||||
},
|
||||
"lib": ["es2015"]
|
||||
}
|
968
package-lock.json
generated
968
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user