Add authenticate
- Create new controller authenticate with login root.. - Update and manage error message socket io. - Create enum for environment variables
This commit is contained in:
parent
e8da727cae
commit
53e1600e67
8 changed files with 85 additions and 7 deletions
|
@ -1,5 +1,6 @@
|
|||
// lib/app.ts
|
||||
import {IoSocketController} from "./Controller/IoSocketController";
|
||||
import {IoSocketController} from "./Controller/IoSocketController"; //TODO fix impot by "_Controller/..."
|
||||
import {AuthenticateController} from "./Controller/AuthenticateController"; //TODO fix impot by "_Controller/..."
|
||||
import express from "express";
|
||||
import {Application} from 'express';
|
||||
import bodyParser = require('body-parser');
|
||||
|
@ -9,14 +10,21 @@ class App {
|
|||
public app: Application;
|
||||
public server: http.Server;
|
||||
public ioSocketController: IoSocketController;
|
||||
public authenticateController: AuthenticateController;
|
||||
|
||||
constructor() {
|
||||
this.app = express();
|
||||
|
||||
//config server http
|
||||
this.config();
|
||||
this.server = http.createServer(this.app);
|
||||
|
||||
//create controllers
|
||||
this.ioSocketController = new IoSocketController(this.server);
|
||||
this.authenticateController = new AuthenticateController(this.app);
|
||||
}
|
||||
|
||||
// TODO add session user
|
||||
private config(): void {
|
||||
this.app.use(bodyParser.json());
|
||||
this.app.use(bodyParser.urlencoded({extended: false}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue