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:
parent
f57f4267c8
commit
666c4969aa
@ -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) {
|
||||
|
@ -87,7 +87,7 @@ function getConfig() {
|
||||
noEmitOnErrors: false
|
||||
},
|
||||
devServer: {
|
||||
contentBase: './dist',
|
||||
// contentBase: './dist', // dist path is directly configured in express
|
||||
hot: true,
|
||||
quiet: true
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user