@Fhillis/

fhillis site

Nodejs

No description

fork
loading
Files
  • index.js
  • public
  • views
  • sites.js

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.29196100458537266","path":"index.js","file":{"path":"index.js","content":{"asEncoding":{"base64":"Y29uc3QgZXhwcmVzcyA9IHJlcXVpcmUoJ2V4cHJlc3MnKTsKY29uc3QgcHVnID0gcmVxdWlyZSgncHVnJyk7CmNvbnN0IHBhdGggPSByZXF1aXJlKCdwYXRoJyk7CmNvbnN0IHNpdGVzID0gcmVxdWlyZShwYXRoLmpvaW4oX19kaXJuYW1lLCJzaXRlcy5qcyIpKTsKCi8vc2V0dXAKCmNvbnN0IGFwcCA9IGV4cHJlc3MoKTsKCmFwcC5zZXQoJ3ZpZXcgZW5naW5lJywgJ3B1ZycpOwoKYXBwLnVzZShleHByZXNzLnN0YXRpYyhwYXRoLmpvaW4oX19kaXJuYW1lLCdwdWJsaWMnKSkpOwoKLy8gd2VicGFnZXMKCmFwcC5nZXQoJy8nLCBhc3luYyBmdW5jdGlvbihyZXEsIHJlcykgewogIHJlcy5yZW5kZXIoJ2luZGV4Jyx7InNpdGVzIjogc2l0ZXN9KQp9KQoKLy9zdGFydGVyCgphc3luYyBmdW5jdGlvbiBzdGFydCgpIHsKICBhcHAubGlzdGVuKDMwMDApOwogIGNvbnNvbGUubG9nKCJzZXJ2ZXIgdXAhIikKfQoKc3RhcnQoKTs="},"asBuffer":null},"loaded":true}}
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