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