-
20170730: Add CORS support
Please refer to this page for more details
-
20170730: Create heroku application
- Create heroku app with heroku-cli
E:\nodejs\knex_crud_api>heroku create knex-crud-api Creating knex-crud-api... done https://knex-crud-api.herokuapp.com/ | https://git.heroku.com/knex-crud-api.git
- heroku addons create: postgresql
E:\nodejs\knex_crud_api>heroku addons:create heroku-postgresql Creating heroku-postgresql on knex-crud-api... free` Database has been created and is available` ! This database is empty. If upgrading, you can transfer` ! data from another database with pg:copy` Created postgresql-round-39560 as DATABASE_URL` Use heroku addons:docs heroku-postgresql to view documentation
- connect to DB
E:\nodejs\knex_crud_api>heroku pg:psql --> Connecting to postgresql-round-39560 psql (9.6.2, 服务器 9.6.1) SSL 连接(协议:TLSv1.2,密码:ECDHE-RSA-AES256-GCM-SHA384,密钥位:256,压缩:关闭) 输入 "help" 来获取帮助信息. knex-crud-api::DATABASE=> \dt 找不到关联。 knex-crud-api::DATABASE=> \q
- open heroku application
> heroku open
- open heroku logs and keep watching
>heroku logs -t
- execute db migration
>heroku run knex migrate:latest
- check db connection again
E:\nodejs\knex_crud_api>heroku pg:psql --> Connecting to postgresql-round-39560 psql (9.6.2, 服务器 9.6.1) SSL 连接(协议:TLSv1.2,密码:ECDHE-RSA-AES256-GCM-SHA384,密钥位:256,压缩:关闭) 输入 "help" 来获取帮助信息. knex-crud-api::DATABASE-> \dt 关联列表 架构模式 | 名称 | 类型 | 拥有者 ----------+----------------------+--------+---------------- public | knex_migrations | 数据表 | jjshdfpxgxslno public | knex_migrations_lock | 数据表 | jjshdfpxgxslno public | sticker | 数据表 | jjshdfpxgxslno (3 行记录)
- seed
>heroku run knex seed:run
-
Execute migration
> knex migrate:latest