helmet and static expires header
This commit is contained in:
parent
a9493190c2
commit
067592df50
@ -1,29 +1,19 @@
|
||||
const express = require('express');
|
||||
const config = require('../../config');
|
||||
const bodyParser = require('body-parser');
|
||||
const helmet = require('helmet');
|
||||
|
||||
const app = express();
|
||||
const api = express.Router();
|
||||
const cors = require('./cors');
|
||||
|
||||
app.use(cors);
|
||||
app.use(helmet());
|
||||
app.use(bodyParser.urlencoded({ extended: false }));
|
||||
app.use(bodyParser.json());
|
||||
|
||||
// Serve insight ui front end from root dir public folder
|
||||
app.use(express.static('../app/www'));
|
||||
app.use('/:stuff', express.static('../app/www'));
|
||||
app.use('/blocks', express.static('../app/www'));
|
||||
app.use('/blocks/:blockhash', express.static('../app/www'));
|
||||
app.use('/block-index', express.static('../app/www'));
|
||||
app.use('/block-index/:height', express.static('../app/www'));
|
||||
app.use('/blocks-date/:date', express.static('../app/www'));
|
||||
app.use('/block/:blockhash', express.static('../app/www'));
|
||||
app.use('/tx/:txid', express.static('../app/www'));
|
||||
app.use('/address/:addr', express.static('../app/www'));
|
||||
app.use('/status', express.static('../app/www'));
|
||||
app.use('/status/:stuff', express.static('../app/www'));
|
||||
app.use('/status/:stuff', express.static('../app/www'));
|
||||
app.use(express.static('../app/www', { maxage: '1w' }));
|
||||
|
||||
app.set('json spaces', config.api.json_spaces);
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
"bitcore-message": "^1.0.4",
|
||||
"body-parser": "^1.17.2",
|
||||
"express": "^4.15.3",
|
||||
"helmet": "^3.8.1",
|
||||
"mongoose": "^4.11.5",
|
||||
"request": "^2.81.0",
|
||||
"socket.io": "^2.0.3",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user