Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yoshiyukikato/knex_app_sample
Application sample for knex.js
https://github.com/yoshiyukikato/knex_app_sample
Last synced: about 1 month ago
JSON representation
Application sample for knex.js
- Host: GitHub
- URL: https://github.com/yoshiyukikato/knex_app_sample
- Owner: YoshiyukiKato
- Created: 2014-12-09T10:36:13.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-26T14:54:52.000Z (almost 10 years ago)
- Last Synced: 2024-04-24T22:33:14.379Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 430 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#About
[ ![travis](https://travis-ci.org/YoshiyukiKato/knex_app_sample.svg?branch=master) ](https://travis-ci.org/YoshiyukiKato/knex_app_sample)Knex.jsを用いたサンプルアプリケーションです。
本アプリケーションについての詳細な説明は、[Qiitaの記事](http://qiita.com/YoshiyukiKato/items/59c9ac742536d706b322)をご覧ください。#Precondition
* Node.js
* PostgreSQL#Usage
##Install```sh
$ git clone [email protected]:YoshiyukiKato/knex_app_sample.git
$ cd knex_app_sample
$ npm install
```
##Build`knexfile.js`の`development`を、自分のデータベース用に書き換えて利用してください。なお、`staging`はTravis CI用の記述になっております。
```js
// Update with your config settings.module.exports = {
development: {
client: 'postgresql',
connection: {
host: "hostname",
user: "username",
database :"database",
password :"password"
},
migrations: {
directory:"./db/migrations",
tableName: 'knex_migrations'
},
seeds: {
directory: './db/seeds/dev'
},
pool:{
min:0,
max:7
}
},staging: {
client: 'postgresql',
connection: {
database: "travis_ci_test",
user: "postgres"
},
pool: {
min: 2,
max: 10
},
migrations: {
directory: "./db/migrations",
tableName: 'knex_migrations'
},
seeds: {
directory: './db/seeds/dev'
}
},production: {
client: 'postgresql',
connection: {
database: 'my_db',
user: 'username',
password: 'password'
},
pool: {
min: 2,
max: 10
},
migrations: {
tableName: 'knex_migrations'
}
}};
```
```sh
$ gulp local_build
```##Run
```sh
$ node app/server.js
``````sh
$ node app/client.js
``````
WebSocket Client Connected:
What is your name?:taro
Password:taropasswd
Login succeeded
Please input number about what you want to do.
1)Withdraw
2)Deposit
3)Pay
4)Quit
:2
How much do you want to deposit? :1000
success: deposit $1000
````##Licence
MIT