Archived
succo ace
This commit is contained in:
@@ -1,14 +1,23 @@
|
||||
const express = require('express');
|
||||
const compression = require('compression')
|
||||
const bodyParser = require('body-parser');
|
||||
const low = require('lowdb');
|
||||
const lodashId = require('lodash-id');
|
||||
const FileAsync = require('lowdb/adapters/FileAsync');
|
||||
const app = express(); // app is an instance of express
|
||||
|
||||
app.use(compression()); // enables gzip compression
|
||||
app.use(bodyParser.urlencoded({ extended: false })) // parse application/x-www-form-urlencoded
|
||||
app.use(bodyParser.json()) // parse application/json
|
||||
app.use(express.static(__dirname + '/build')); // serve static build site
|
||||
|
||||
|
||||
app.get('/a', (req, res) => {
|
||||
res.send(process.env);
|
||||
|
||||
});
|
||||
|
||||
|
||||
// Create database instance and start server
|
||||
// const adapter = new FileAsync(__dirname + '/db.json');
|
||||
low(new FileAsync(__dirname + '/db.json')) // production
|
||||
|
||||
Reference in New Issue
Block a user