Open dailynodejs opened 3 years ago
用到了:
const Router = require('koa-router');
有 2 个路由配置:
_.forEach(strapi.config.routes, value => {
});
_.get(strapi.admin, 'config.routes', []).forEach(route => {
});
admin | Admin panel configuration | Object | |
---|---|---|---|
admin.auth | Authentication configuration | Object | |
admin.auth.secret | Secret used to encode JWT tokens | string | undefined |
admin.url | Url of your admin panel. Default value: /admin. Note: If the url is relative, it will be concatenated with url. | string | /admin |
admin.autoOpen | Enable or disabled administration opening on start. | boolean | true |
admin.watchIgnoreFiles | Add custom files that should not be watched during development. See more here (opens new window)(property ignored). | Array(string) | [] |
admin.host | Use a different host for the admin panel. Only used along with strapi develop --watch-admin | string | localhost |
admin.port | Use a different port for the admin panel. Only used along with strapi develop --watch-admin | string | 8000 |
admin.serveAdminPanel | If false, the admin panel won't be served. Note: the index.html will still be served, see defaultIndex option | boolean | true |
admin.forgotPassword | Settings to customize the forgot password email (see more here: Forgot Password Email) | Object | {} |
admin.forgotPassword.emailTemplate | Email template as defined in email plugin | Object | Default template(opens new window) |
admin.forgotPassword.from | Sender mail address | string | Default value defined in your provider configuration |
admin.forgotPassword.replyTo | Default address or addresses the receiver is asked to reply to | string | Default value defined in your provider configuration |
Strapi 是什么?
创建 Content-Type
这个是创建表时默认结尾会加个s,在高级设置中可以自己设置表名
访问方式
Single Types
api 文件夹
config 文件夹
config/functions/bootstrap.js
官网地址
我们在这里打印一下 strapi:
打印一下:
strapi.app.use
自定义404
config/functions/responses/404.js
访问一个不存在的地址:
命令
strapi develop
strapi build
strapi start
plugin
strapi-plugin-content-manager