add server do not response map file if production
This commit is contained in:
parent
93a65c271a
commit
eb7e2783ec
@ -58,6 +58,7 @@ export async function create_server(){
|
|||||||
})}
|
})}
|
||||||
static_file_server('dist/css/style.css','css');
|
static_file_server('dist/css/style.css','css');
|
||||||
static_file_server('dist/js/bundle.js','js');
|
static_file_server('dist/js/bundle.js','js');
|
||||||
|
if(setting.mode === "development")
|
||||||
static_file_server('dist/js/bundle.js.map','text');
|
static_file_server('dist/js/bundle.js.map','text');
|
||||||
|
|
||||||
const content_router = getContentRouter(createKnexContentsAccessor(db));
|
const content_router = getContentRouter(createKnexContentsAccessor(db));
|
||||||
@ -67,6 +68,7 @@ export async function create_server(){
|
|||||||
router.post('/user/login',createLoginMiddleware(db));
|
router.post('/user/login',createLoginMiddleware(db));
|
||||||
router.post('/user/logout',LogoutMiddleware);
|
router.post('/user/logout',LogoutMiddleware);
|
||||||
|
|
||||||
|
if(setting.mode == "development"){
|
||||||
let mm_count = 0;
|
let mm_count = 0;
|
||||||
app.use(async (ctx,next)=>{
|
app.use(async (ctx,next)=>{
|
||||||
console.log(`==========================${mm_count++}`);
|
console.log(`==========================${mm_count++}`);
|
||||||
@ -74,7 +76,7 @@ export async function create_server(){
|
|||||||
console.log(`${fromClient} : ${ctx.method} ${ctx.url}`);
|
console.log(`${fromClient} : ${ctx.method} ${ctx.url}`);
|
||||||
await next();
|
await next();
|
||||||
//console.log(`404`);
|
//console.log(`404`);
|
||||||
});
|
});}
|
||||||
app.use(router.routes());
|
app.use(router.routes());
|
||||||
app.use(router.allowedMethods());
|
app.use(router.allowedMethods());
|
||||||
return app;
|
return app;
|
||||||
|
Loading…
Reference in New Issue
Block a user