Knex.js示例应用程序配置与使用指南
这是一个使用Knex.js的示例应用程序。有关此应用程序的详细说明,请参考以下内容。
前提:需要安装Node.js和PostgreSQL数据库。
用法
安装步骤
- 克隆仓库:
$ git clone git@github.com:YoshiyukiKato/knex_app_sample.git
- 进入项目目录:
$ cd knex_app_sample
- 安装依赖:
$ npm install
配置knexfile.js
根据自己的数据库设置配置knexfile.js中的development和staging选项(后者用于Travis CI)。
module.exports = {
development: {
client: 'postgresql',
connection: {
host: 'your_host',
user: 'your_user',
password: 'your_password',
database: 'your_database'
}
}
};
根据个人环境更新数据库连接配置。
下载地址
用户评论