Skip to content

Commit c977d92

Browse files
committed
Remove example as submodule
1 parent c3b5eaf commit c977d92

15 files changed

Lines changed: 209 additions & 5 deletions

File tree

.gitmodules

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

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+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"passport": {
3+
"strategies": [
4+
"bearer", "basic", "clientPassword"
5+
],
6+
"defaultStrategy": "bearer",
7+
"strategyOptions": {
8+
"session": false
9+
}
10+
}
11+
}

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: 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+
let Dog = app.dao.Dog;
5+
let json = new app.views.Json();
6+
7+
this.list = function (request, response, next) {
8+
let dog = new Dog();
9+
json.promise(dog.list(), response, next);
10+
};
11+
};

example/controllers/user.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
module.exports = function (app) {
4+
let json = new app.views.Json();
5+
6+
this.get = function (req, res) {
7+
json.standard(req.user, res);
8+
};
9+
};

example/dao/dog.js

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 = class DogDAO {
4+
constructor (app) {
5+
this.dao = new app.models.Dog();
6+
}
7+
8+
list () {
9+
return this.dao.list();
10+
};
11+
};

example/dao/o_auth2.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 = class OAuth2DAO {
4+
token (server, OAuth2) {
5+
server.exchange(OAuth2.exchange.password(
6+
(client, mail, password, scope, done) => done(null, '123456')
7+
));
8+
9+
server.exchange(OAuth2.exchange.refreshToken(
10+
(client, refreshToken, scope, done) => done(null, '123456')
11+
));
12+
}
13+
};

0 commit comments

Comments
 (0)