Queries are working

This commit is contained in:
2021-01-30 05:50:04 +11:00
parent 488c32eea2
commit 689a3371f1
12 changed files with 3824 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
//environment variables
require('dotenv').config();
//create the server
const express = require('express');
const app = express();
const server = require('http').Server(app);
//database connection
const database = require('./database');
//access the news
app.use('/news', require('./news'));
//error on access
app.get('*', (req, res) => {
res.redirect('https://github.com/krgamestudios/news-server');
});
//startup
server.listen(process.env.WEB_PORT || 3100, (err) => {
console.log(`listening to localhost:${process.env.WEB_PORT || 3100}`);
});