@Vandesm14/

LameBrokenDemos

Express

No description

fork
loading
Files
  • index.js
  • public
  • routes
  • views
  • db.js
  • db.sqlite3
  • package-lock.json
  • package.json

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.7989322457843739","path":"index.js","file":{"path":"index.js","content":{"asEncoding":{"base64":"Y29uc3QgZXhwcmVzcyA9IHJlcXVpcmUoJ2V4cHJlc3MnKTsKY29uc3QgYm9keVBhcnNlciA9IHJlcXVpcmUoJ2JvZHktcGFyc2VyJyk7Cgpjb25zdCBhcHAgPSBleHByZXNzKCk7CgphcHAudXNlKGJvZHlQYXJzZXIuanNvbigpKTsKYXBwLnVzZShib2R5UGFyc2VyLnVybGVuY29kZWQoeyBleHRlbmRlZDogdHJ1ZSB9KSk7CmFwcC51c2UoZXhwcmVzcy5zdGF0aWMoJ3B1YmxpYycpKTsKCmFwcC51c2UocmVxdWlyZSgnLi9yb3V0ZXMvZ3Vlc3Rib29rJykpOwoKYXBwLmdldCgnL2FwaS1kb2NzJywgKHJlcSwgcmVzKSA9PiB7CglyZXMuc2VuZEZpbGUoX19kaXJuYW1lICsgJy92aWV3cy9hcGktaW5kZXguaHRtbCcpOwp9KTsKCmFwcC5nZXQoJy8nLCAocmVxLCByZXMpID0+IHsKCXJlcy5zZW5kRmlsZShfX2Rpcm5hbWUgKyAnL3ZpZXdzL2luZGV4Lmh0bWwnKTsKfSk7Cgpjb25zdCBwb3J0ID0gcHJvY2Vzcy5lbnYuUE9SVCB8fCA4MDgwOwphcHAubGlzdGVuKHBvcnQsICcwLjAuMC4wJywgKCkgPT4gewoJY29uc29sZS5sb2coYFNlcnZlciBzdGFydGVkIG9uIHBvcnQgJHtwb3J0fWApOwp9KTs="},"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
const express = require('express');
const bodyParser = require('body-parser');

const app = express();

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.static('public'));

app.use(require('./routes/guestbook'));

app.get('/api-docs', (req, res) => {
	res.sendFile(__dirname + '/views/api-index.html');
});

app.get('/', (req, res) => {
	res.sendFile(__dirname + '/views/index.html');
});

const port = process.env.PORT || 8080;
app.listen(port, '0.0.0.0', () => {
	console.log(`Server started on port ${port}`);
});