1. 首页
  2. 考试认证
  3. 其它
  4. Knex.js示例应用程序配置与使用指南

Knex.js示例应用程序配置与使用指南

上传者: 2024-11-05 16:45:39上传 ZIP文件 13.05KB 热度 13次

这是一个使用Knex.js的示例应用程序。有关此应用程序的详细说明,请参考以下内容。

前提:需要安装Node.jsPostgreSQL数据库。

用法

安装步骤

  1. 克隆仓库:

$ git clone git@github.com:YoshiyukiKato/knex_app_sample.git

  1. 进入项目目录:

$ cd knex_app_sample

  1. 安装依赖:

$ npm install

配置knexfile.js

根据自己的数据库设置配置knexfile.js中的developmentstaging选项(后者用于Travis CI)。


module.exports = {

  development: {

    client: 'postgresql',

    connection: {

      host: 'your_host',

      user: 'your_user',

      password: 'your_password',

      database: 'your_database'

    }

  }

};

根据个人环境更新数据库连接配置。

下载地址
用户评论