Commit 7ad6dace authored by project's avatar project

--no commit message

--no commit message
parent 0bd32ecc
var ctx = require('../context');
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var cfg = ctx.config;
module.exports.create = function(cfg)
{
var hs = new HTTPListener(cfg);
return hs;
}
function HTTPListener(cfg)
{
this.config = cfg;
}
HTTPListener.prototype.start = function()
{
console.log('Starting HTTP Listener ...\n');
this.http_start();
}
HTTPListener.prototype.http_start = function()
{
var self = this;
var API_PORT = 19180;
app.use(bodyParser.json({limit: '5mb'}));
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(require('./ws'));
app.listen(API_PORT, function () {
console.log('WWW:HTTP START\t\t[OK]');
});
}
var express = require('express')
, router = express.Router()
router.use('/',require('./service-main'));
module.exports = router;
var ctx = require('../../context');
var express = require('express');
var router = express.Router();
var cfg = ctx.config;
var response = ctx.getLib('lib/ws/response');
var request = ctx.getLib('lib/ws/request');
router.get('/:akey',function (req, res) {
var reqHelper = request.create(req);
var respHelper = response.create(res);
var appkey = req.params.akey;
respHelper.responseOK({'status':'OK','appkey':appkey});
});
module.exports = router;
var ctx = require('./context');
var HTTPListener = ctx.getLib('http-listener/main');
var hs = HTTPListener.create(ctx.config);
hs.start();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment