Compare commits

..

No commits in common. "5de66bfb7bf975d03bb7ab38b47ee80176ee190d" and "285329bbce08603e3751a762e590075a4510c876" have entirely different histories.

2 changed files with 13 additions and 5 deletions

View File

@ -1,25 +1,33 @@
// Import things // Import things
const express = require('express'); const express = require('express');
const { is } = require('express/lib/request');
const res = require('express/lib/response');
const app = express(); const app = express();
const path = require('path');
const server = require('http').createServer(app); const server = require('http').createServer(app);
const port = process.env.PORT || 3430; const port = process.env.PORT || 3430;
var fs = require('fs');;
// Set the templates folder for the thingy // Database for the demo site,
var demoDB = [
{
name: "Poggere"
}
];
// Use /Public as the path for css and such
app.set('views', __dirname + '/../Templates'); app.set('views', __dirname + '/../Templates');
app.set('view engine', 'ejs'); app.set('view engine', 'ejs');
// Makes it so that the Public folder mounts under /
app.use(express.static(__dirname + '/../Public')); app.use(express.static(__dirname + '/../Public'));
// Main page // Main page
app.get('/', function(req, res){ app.get('/', function(req, res){
res.render('index'); res.render('app', {site:1, db: demoDB});
}); });
// Simple way to expose a function // Simple way to expose a function
exports = module.exports = rws; exports = module.exports = rws;
// rws = RunWebServer
function rws() { function rws() {
server.listen(port, () => { server.listen(port, () => {
console.log('✅ Webserver is running ( %d )', port); console.log('✅ Webserver is running ( %d )', port);