redid database structures and now running SQLite and Seqelize

This commit is contained in:
plane000
2018-08-27 17:53:45 +01:00
parent c11aab31a0
commit 1ac8ea9b96
12 changed files with 899 additions and 251 deletions

View File

@@ -9,12 +9,13 @@ let app;
export class Router {
static async initEndpoints() {
Logger.info('Setting up API HTTP endpoints');
app = Server.App;
app.get('/', [MiddleWare.analytics, Router.frontPage]);
app.get('/user/:id', (req, res) => [MiddleWare.analytics]);
app.delete('/user/:id', (req, res) => {});
app.get('/user/:id', [MiddleWare.analytics]);
app.delete('/user/:id', [MiddleWare.analytics]);
app.post('/user', [MiddleWare.analytics, Controllers.UserController.newUser]);
app.use([MiddleWare.analytics, StatusCodes.pageNotFound]);

View File

@@ -4,6 +4,11 @@ import {ControllerHandler} from './controllerHandler';
export class UserController extends ControllerHandler {
static newUser(req, res, next) {
Logger.info('NEW USER');
let username = req.body.username || null;
let email = req.body.email || null;
let password = req.body.password || null;
next();
}
}