repl.it
@GarethDwyer1/

node-express-sqlite

Express

No description

fork
loading
Files
  • index.js
  • public
  • Packager files
  • package.json
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const express = require('express');
const bodyParser = require('body-parser');
const sqlite3 = require('sqlite3').verbose()
const db = new sqlite3.Database('db.sqlite')

const app = express();

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

app.use(express.static('public'));

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

app.listen(3000, () => console.log('server started'));
Fetching token
?