Skip to content

Commit e2c84f2

Browse files
authored
Merge pull request #8 from BoolJS/develop
Update to API v0.6.0
2 parents 13af817 + 78f673f commit e2c84f2

15 files changed

Lines changed: 149 additions & 9 deletions

File tree

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
before_script:
3-
- npm install booljs@latest --no-save
3+
- npm install booljs
44
node_js:
55
- lts/*
66

example

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/.jshintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"node": true,
3+
"laxcomma": true,
4+
"undef": true,
5+
"strict": true,
6+
"unused": true
7+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
3+
"development": {
4+
"host": "localhost",
5+
"database": "db"
6+
},
7+
8+
"test": {
9+
"host": "localhost",
10+
"database": "db_test"
11+
},
12+
13+
"production": {
14+
"host": "example.com",
15+
"database": "db"
16+
}
17+
18+
}

example/configuration/server.cson

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'host': 'localhost'
2+
'port': 8080
3+
'credentials':
4+
'user': 'example'
5+
'password': 'samplepass'

example/controllers/dog.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
module.exports = function(app){
4+
5+
var Dog = app.dao.Dog
6+
, json = new app.views.Json();
7+
8+
return {
9+
list: function(req, res, next){
10+
var dog = new Dog();
11+
json.promise(dog.list(), res, next);
12+
}
13+
};
14+
15+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
module.exports = function (app) {
4+
const { Dog } = app.dao;
5+
const { promise } = new app.views.Json();
6+
7+
this.list = function (request, response, next) {
8+
var dog = new Dog();
9+
promise(dog.list(), response, next);
10+
};
11+
};

example/dao/dog.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
3+
module.exports = function(app){
4+
5+
var dog = new app.models.Dog();
6+
7+
return {
8+
list: function(){
9+
return dog.list();
10+
}
11+
};
12+
13+
};

example/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
const Bool = require('booljs');
3+
4+
// Here is where magic happens
5+
module.exports = (async () => {
6+
try {
7+
return new Bool('com.example.api', [ require.resolve('..') ])
8+
.setServerDrivers([ 'booljs.express' ])
9+
.run();
10+
} catch (error) {
11+
console.error(error);
12+
}
13+
})();

0 commit comments

Comments
 (0)