2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

Manually register staticPath in express

This commit is contained in:
Faris Ansari 2018-08-10 17:41:48 +05:30
parent f57f4267c8
commit 666c4969aa
2 changed files with 7 additions and 2 deletions

View File

@ -25,7 +25,7 @@ require.extensions['.html'] = function (module, filename) {
};
module.exports = {
async start({backend, connectionParams, models, staticPath = './', authConfig=null}) {
async start({backend, connectionParams, models, authConfig=null}) {
await this.init();
if (models) {
@ -38,6 +38,11 @@ module.exports = {
// app
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
for (let staticPath of [appConfig.distPath, appConfig.staticPath]) {
app.use(express.static(staticPath));
}
app.use(morgan('tiny'));
if (connectionParams.enableCORS) {

View File

@ -87,7 +87,7 @@ function getConfig() {
noEmitOnErrors: false
},
devServer: {
contentBase: './dist',
// contentBase: './dist', // dist path is directly configured in express
hot: true,
quiet: true
},