config.default.js是这样的:
'use strict';
module.exports = appInfo => {
const config = {};
// use for cookie sign key, should change to your own and keep security
config.keys = appInfo.name + '_1507383951618_490';
// add your config here
config.middleware = [];
config.static = {
maxAge: 31536000,
prefix: '/public',
index: 'index.html'
}
return config;
};
不支持目录
@popomore
不支持目录可以理解,但是首页也是这样404总不行吧?
http://localhost:7001/ => 404
http://localhost:7001/index.html => OK
Solved!
import { controller, get, provide } from 'midway';
@provide()
@controller('/')
export class HomeController {
@get('/')
async index(ctx) {
ctx.redirect('/index.html')
}
}