mirror of
https://github.com/frappe/books.git
synced 2025-01-25 16:18:33 +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 = {
|
module.exports = {
|
||||||
async start({backend, connectionParams, models, staticPath = './', authConfig=null}) {
|
async start({backend, connectionParams, models, authConfig=null}) {
|
||||||
await this.init();
|
await this.init();
|
||||||
|
|
||||||
if (models) {
|
if (models) {
|
||||||
@ -38,6 +38,11 @@ module.exports = {
|
|||||||
// app
|
// app
|
||||||
app.use(bodyParser.json());
|
app.use(bodyParser.json());
|
||||||
app.use(bodyParser.urlencoded({ extended: true }));
|
app.use(bodyParser.urlencoded({ extended: true }));
|
||||||
|
|
||||||
|
for (let staticPath of [appConfig.distPath, appConfig.staticPath]) {
|
||||||
|
app.use(express.static(staticPath));
|
||||||
|
}
|
||||||
|
|
||||||
app.use(morgan('tiny'));
|
app.use(morgan('tiny'));
|
||||||
|
|
||||||
if (connectionParams.enableCORS) {
|
if (connectionParams.enableCORS) {
|
||||||
|
@ -87,7 +87,7 @@ function getConfig() {
|
|||||||
noEmitOnErrors: false
|
noEmitOnErrors: false
|
||||||
},
|
},
|
||||||
devServer: {
|
devServer: {
|
||||||
contentBase: './dist',
|
// contentBase: './dist', // dist path is directly configured in express
|
||||||
hot: true,
|
hot: true,
|
||||||
quiet: true
|
quiet: true
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user