setted up restapi in json

This commit is contained in:
coderaiser 2012-11-15 10:39:04 -05:00
parent 37e34e868f
commit 4da6cf8784
2 changed files with 8 additions and 5 deletions

View file

@ -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;
}

View file

@ -1,6 +1,6 @@
{
"name": "cloudcmd",
"version": "0.1.7-20",
"version": "0.1.7",
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
"description": "Two-panels file manager, totally writed on js.",
"homepage": "https://github.com/coderaiser/cloudcmd",