Create backend

- NodeJs
 - Express
 - Socket.io
 - Eslint
 - TypeScript
This commit is contained in:
gparant 2020-04-04 04:08:12 +02:00
parent c0e75ae07e
commit ba335aa33d
10 changed files with 2277 additions and 0 deletions

26
back/src/App.ts Normal file
View file

@ -0,0 +1,26 @@
// lib/app.ts
import {IoSocketController} from "./Controller/IoSocketController";
import express from "express";
import {Application} from 'express';
import bodyParser = require('body-parser');
import * as http from "http";
class App {
public app: Application;
public server: http.Server;
public ioSocketController: IoSocketController;
constructor() {
this.app = express();
this.config();
this.server = http.createServer(this.app);
this.ioSocketController = new IoSocketController(this.server);
}
private config(): void {
this.app.use(bodyParser.json());
this.app.use(bodyParser.urlencoded({extended: false}));
}
}
export default new App().server;