Structure copied from chat-server

This commit is contained in:
2021-03-06 14:49:02 +11:00
parent 6d3f068c8f
commit 725842f672
10 changed files with 148 additions and 1 deletions
+29
View File
@@ -0,0 +1,29 @@
//environment variables
require('dotenv').config();
//create the server
const express = require('express');
const app = express();
const server = require('http').Server(app);
const bodyParser = require('body-parser');
const cors = require('cors');
//config
app.use(bodyParser.json());
app.use(cors());
//database connection
const database = require('./database');
//access the news
app.use('/auth', require('./auth'));
//error on access
app.get('*', (req, res) => {
res.redirect('https://github.com/krgamestudios/auth-server');
});
//startup
server.listen(process.env.WEB_PORT || 3200, (err) => {
console.log(`listening to localhost:${process.env.WEB_PORT || 3200}`);
});