1.0.6 • Published 7 years ago
node-core v1.0.6
简介
node-core
是一个基于 Egg.js 的 Node.js 服务端基础框架。
安装
$ npm install --save node-core
案例
一个完整的例子:链接。
问题和建议
请提 issue:链接。
已支持的插件
参考
- Node.js 中文网
- Node之旅
- Egg.js 官网
- 框架开发
- Egg.js 中间件
- 前后端分离之JWT用户认证
- NodeJs JsonWebToken
- NodeJs使用json web token验证REST服务
- JWT Example
- sequelizejs docs
- EJS 中文文档
- EJS 模板语言使用
使用方法
创建 articles
model:
// app/model/articles.js
module.exports = app => {
const {STRING, TEXT, INTEGER} = app.Sequelize
return app.model.define('articles', {
id: {
type: INTEGER(8),
primaryKey: true,
autoIncrement: true,
allowNull: false
},
author: {
type: STRING(50),
allowNull: true
},
title: {
type: STRING(200),
allowNull: false
},
subtitle: {
type: STRING(200),
allowNull: true
},
description: {
type: TEXT('tiny'),
},
content: {
type: TEXT('long'),
allowNull: true
},
image: {
type: INTEGER(8),
allowNull: true
},
category_id: {
type: INTEGER,
allowNull: true
}
})
}
创建 articles
service:
// app/service/articles.js
module.exports = app => {
return class extends app.Service {
constructor (ctx) {
super(ctx)
this.module = 'articles'
}
}
}
创建 articles
controller:
// app/controller/articles.js
module.exports = app => {
return class extends app.Controller {
constructor (ctx) {
super(ctx)
this.module = 'articles'
}
}
}
1.0.6
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
0.1.17
7 years ago
0.1.16
7 years ago
0.1.15
7 years ago
0.1.14
7 years ago
0.1.13
7 years ago
0.1.12
7 years ago
0.1.11
7 years ago
0.1.10
7 years ago
0.1.9
7 years ago
0.1.8
7 years ago
0.1.7
7 years ago
0.1.6
7 years ago
0.1.5
7 years ago
0.1.4
7 years ago
0.1.3
7 years ago
0.1.1
7 years ago
0.0.19
7 years ago
0.0.18
7 years ago
0.0.17
7 years ago
0.0.16
7 years ago
0.0.15
7 years ago
0.0.14
7 years ago
0.0.13
7 years ago
0.0.12
7 years ago
0.0.11
7 years ago
0.0.10
7 years ago
0.0.9
7 years ago
0.0.8
7 years ago
0.0.7
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago
1.0.0
7 years ago