-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from Adamant-im/dev
Release 0.5.0
- Loading branch information
Showing
26 changed files
with
1,711 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
'use strict'; | ||
|
||
const Router = require('../../helpers/router'); | ||
const httpApi = require('../../helpers/httpApi'); | ||
|
||
/** | ||
* Binds api with modules and creates common url. | ||
* - End point: `/api/chatrooms` | ||
* | ||
* - Sanitized | ||
* - get /:ID | ||
* - get /:ID/:ID | ||
* @memberof module:chatrooms | ||
* @requires helpers/Router | ||
* @requires helpers/httpApi | ||
* @constructor | ||
* @param {Object} chatroomsModule - Module chats instance. | ||
* @param {scope} app - Network app. | ||
*/ | ||
// Constructor | ||
function ChatroomsHttpApi (chatroomsModule, app) { | ||
|
||
const router = new Router(); | ||
|
||
router.map(chatroomsModule.internal, { | ||
'get /U*/U*': 'getMessages', | ||
'get /U*': 'getChats', | ||
}); | ||
|
||
|
||
httpApi.registerEndpoint('/api/chatrooms', app, router, chatroomsModule.isLoaded); | ||
} | ||
|
||
module.exports = ChatroomsHttpApi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'use strict'; | ||
|
||
var Router = require('../../helpers/router'); | ||
var httpApi = require('../../helpers/httpApi'); | ||
var schema = require('../../schema/node.js'); | ||
|
||
/** | ||
* Binds api with modules and creates common url. | ||
* - End point: `/api/node` | ||
* - Public API: | ||
- get /status | ||
* @memberof module:node | ||
* @requires helpers/Router | ||
* @requires helpers/httpApi | ||
* @constructor | ||
* @param {Object} nodeModule - Module node instance. | ||
* @param {scope} app - Network app. | ||
*/ | ||
|
||
function NodeHttpApi (nodeModule, app) { | ||
|
||
var router = new Router(); | ||
|
||
router.map(nodeModule.shared, { | ||
'get /status': 'getStatus', | ||
}); | ||
|
||
|
||
httpApi.registerEndpoint('/api/node', app, router, nodeModule.isLoaded); | ||
} | ||
|
||
module.exports = NodeHttpApi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.