Nodejs

No description

fork
loading
Files
  • index.js
  • controllers
  • public
  • socket
  • views
  • package-lock.json
  • package.json

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.1291796801043641","path":"index.js","file":{"path":"index.js","content":{"asEncoding":{"base64":"Y29uc29sZS5sb2coJ3NlcnZlciBzdGFydGluZycpCgpjb25zdCBleHByZXNzID0gcmVxdWlyZSgnZXhwcmVzcycpOwpjb25zdCBodHRwID0gcmVxdWlyZSgnaHR0cCcpOwpjb25zdCBwdWcgPSAgcmVxdWlyZSgncHVnJyk7Cgpjb25zdCBhcHAgPSBleHByZXNzKCk7CmNvbnN0IHNlcnZlciA9IGh0dHAuY3JlYXRlU2VydmVyKGFwcCk7CgphcHAuZW5naW5lKCdwdWcnLCBwdWcuX19leHByZXNzKTsKYXBwLnNldCgndmlldyBlbmdpbmUnLCAncHVnJyk7CmFwcC51c2UoZXhwcmVzcy5zdGF0aWMoX19kaXJuYW1lICsgJy9wdWJsaWMnKSkKYXBwLnVzZShyZXF1aXJlKCcuL2NvbnRyb2xsZXJzJykpOwphcHAudXNlKHJlcXVpcmUoJ2Nvb2tpZS1wYXJzZXInKSgpKTsKYXBwLnVzZShyZXF1aXJlKCdib2R5LXBhcnNlcicpLnVybGVuY29kZWQoeyBleHRlbmRlZDogdHJ1ZSB9KSk7CmFwcC51c2UocmVxdWlyZSgnZXhwcmVzcy1zZXNzaW9uJykoeyAKICAgIHNlY3JldDogJ2tleWJvYXJkIGNhdCcsIAogICAgcmVzYXZlOiB0cnVlLCBzYXZlVW5pbml0aWFsaXplZDogdHJ1ZSAKfSkpOwoKCgpzZXJ2ZXIubGlzdGVuKDMwMDAsIGZ1bmN0aW9uKCkgewogIGNvbnNvbGUubG9nKCdMaXN0ZW5pbmcgb24gcG9ydCAzMDAwLi4uJykKfSk="},"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
console.log('server starting')

const express = require('express');
const http = require('http');
const pug =  require('pug');

const app = express();
const server = http.createServer(app);

app.engine('pug', pug.__express);
app.set('view engine', 'pug');
app.use(express.static(__dirname + '/public'))
app.use(require('./controllers'));
app.use(require('cookie-parser')());
app.use(require('body-parser').urlencoded({ extended: true }));
app.use(require('express-session')({ 
    secret: 'keyboard cat', 
    resave: true, saveUninitialized: true 
}));



server.listen(3000, function() {
  console.log('Listening on port 3000...')
})
node v10.16.0