Add frontend to be served by backend.
This commit is contained in:
16
backend/src/js/app.js
Normal file
16
backend/src/js/app.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const express = require('express');
|
||||
const bodyParser = require('body-parser');
|
||||
const applicationController = require('./controller/applicationCtrl');
|
||||
const userController = require('./controller/userCtrl');
|
||||
|
||||
const port = 3000;
|
||||
|
||||
const app = express();
|
||||
app.use(bodyParser.urlencoded({ extended: true }));
|
||||
app.use(bodyParser.json());
|
||||
app.use(express.static('backend/public'));
|
||||
|
||||
app.use('/apps', applicationController);
|
||||
app.use('/users', userController);
|
||||
|
||||
app.listen(port, () => console.log('Mock is listening at port ', port, '\n'));
|
||||
Reference in New Issue
Block a user