@Fhillis/

fhillis site

Nodejs

No description

fork
loading
Files
  • index.js
  • public
  • views
  • sites.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const express = require('express');
const pug = require('pug');
const path = require('path');
const sites = require(path.join(__dirname,"sites.js"));

//setup

const app = express();

app.set('view engine', 'pug');

app.use(express.static(path.join(__dirname,'public')));

// webpages

app.get('/', async function(req, res) {
  res.render('index',{"sites": sites})
})

//starter

async function start() {
  app.listen(3000);
  console.log("server up!")
}

start();
node v10.16.0