mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 18:35:09 +01:00
Fix ESLint errors on server and dev server
This commit is contained in:
parent
aff95af78f
commit
42d35e7807
@ -2,7 +2,6 @@
|
|||||||
/* eslint-disable import/no-extraneous-dependencies, import/newline-after-import */
|
/* eslint-disable import/no-extraneous-dependencies, import/newline-after-import */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const path = require('path');
|
|
||||||
const removeTrailingSlash = require('remove-trailing-slash');
|
const removeTrailingSlash = require('remove-trailing-slash');
|
||||||
|
|
||||||
const WebpackDevServer = require('webpack-dev-server');
|
const WebpackDevServer = require('webpack-dev-server');
|
||||||
|
10
server.js
10
server.js
@ -1,6 +1,9 @@
|
|||||||
|
/* eslint-disable strict, no-console */
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
const compression = require('compression');
|
const compression = require('compression');
|
||||||
const path = require('path');
|
|
||||||
const removeTrailingSlash = require('remove-trailing-slash');
|
const removeTrailingSlash = require('remove-trailing-slash');
|
||||||
|
|
||||||
const BASE_PATH = removeTrailingSlash(process.env.ONION_BASE_PATH || '/');
|
const BASE_PATH = removeTrailingSlash(process.env.ONION_BASE_PATH || '/');
|
||||||
@ -13,9 +16,10 @@ app.use(compression());
|
|||||||
app.use(path.join(BASE_PATH, '/static/js'), express.static(path.resolve(__dirname, 'dist/js')));
|
app.use(path.join(BASE_PATH, '/static/js'), express.static(path.resolve(__dirname, 'dist/js')));
|
||||||
app.use(path.join(BASE_PATH, '/static/css'), express.static(path.resolve(__dirname, 'dist/css')));
|
app.use(path.join(BASE_PATH, '/static/css'), express.static(path.resolve(__dirname, 'dist/css')));
|
||||||
app.use(path.join(BASE_PATH, '/static/fonts'), express.static(path.resolve(__dirname, 'dist/fonts')));
|
app.use(path.join(BASE_PATH, '/static/fonts'), express.static(path.resolve(__dirname, 'dist/fonts')));
|
||||||
app.use(path.join(BASE_PATH, '/static/third_party'), express.static(path.resolve(__dirname, 'dist/third_party')));
|
app.use(path.join(BASE_PATH, '/static/third_party'),
|
||||||
|
express.static(path.resolve(__dirname, 'dist/third_party')));
|
||||||
|
|
||||||
app.get(/.*/, function(req, res) {
|
app.get(/.*/, (req, res) => {
|
||||||
console.log('%s %s', req.method, req.path);
|
console.log('%s %s', req.method, req.path);
|
||||||
res.sendFile(path.resolve(__dirname, 'dist/index.html'));
|
res.sendFile(path.resolve(__dirname, 'dist/index.html'));
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* eslint-disable strict, no-console, object-shorthand */
|
/* eslint-disable strict, no-console, object-shorthand, prefer-template */
|
||||||
/* eslint-disable import/no-extraneous-dependencies, import/newline-after-import */
|
/* eslint-disable import/no-extraneous-dependencies, import/newline-after-import */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user