mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
setted up restapi in json
This commit is contained in:
parent
001143995b
commit
be4a31ae58
2 changed files with 8 additions and 5 deletions
|
|
@ -6,9 +6,10 @@
|
|||
var DIR = process.cwd() + '/',
|
||||
main = require(DIR + 'lib/server/main'),
|
||||
Util = main.util,
|
||||
|
||||
APIURL = '/api/v1';
|
||||
|
||||
|
||||
APIURL = '/api/v1',
|
||||
OK = 200;
|
||||
|
||||
/**
|
||||
* rest interface
|
||||
* @pConnectionData {request, responce}
|
||||
|
|
@ -23,7 +24,9 @@
|
|||
console.log(lUrl);
|
||||
console.log(lMethod);
|
||||
|
||||
if( Util.isContainStr(lUrl, APIURL) ){
|
||||
if( Util.isContainStr(lUrl, APIURL) ){
|
||||
var lHead = main.generateHeaders('api.json', false);
|
||||
lRes.writeHead(OK, lHead);
|
||||
lRes.end(APIURL);
|
||||
lRet = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue