# adonisjs_blog **Repository Path**: CC3688/adonisjs_blog ## Basic Information - **Project Name**: adonisjs_blog - **Description**: adonisjs_blog - **Primary Language**: NodeJS - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-12-03 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 这是在Youtube 学习 Adonis 的项目 ## 目标与功能 - 实现了对一个数据表的删除改查 - 对表单的验证 - 对数据库 migration 的使用 - cli 命令的使用 ## 小结 - 数据库相关 - 生产 数据表迁移 > \> adonis make:migration table_name > 然后你就可以到database/migrations目录下相应的文件,设计表结构了 - 迁移到数据库,同步到数据库 > \> adonis migration:run > 数据库就有了你刚设计的表了 - 模型 Model > adonis make:model model_name - 控制器 > adonis make:controller controller_name - 单表操作 需要在控制器内先引入模型 - 增 > 模型实例.save() - 查 > 模型实例.find() 需要传入参数 - 改 > 模型实例.update() - 删 > 模型实例.delete() - 生成视图 > \>adonis make:view view_name - validator > \>npm i -S @adonisjs/validator > 使用需要先安装, 然后start/app.js ## 运行 如果你需要下载到本地运行,你可以先克隆到本地然后,尝试按下面方法去 - 复一份.env.example 改名为:.env ,并填写好数据库存的配置 - 运行 adonis migrate:run - 运行 adonis migrate - 运行 npm run start # Adonis fullstack application This is the fullstack boilerplate for AdonisJs, it comes pre-configured with. 1. Bodyparser 2. Session 3. Authentication 4. Web security middleware 5. CORS 6. Edge template engine 7. Lucid ORM 8. Migrations and seeds ## Setup Use the adonis command to install the blueprint ```bash adonis new yardstick ``` or manually clone the repo and then run `npm install`. ### Migrations Run the following command to run startup migrations. ```js adonis migration:run ```