xmt-base
Version:
Backend Server Framework of XmT Inc.
43 lines • 1.47 kB
JavaScript
;
const index_1 = require("../index");
const user_1 = require("./user");
const article_1 = require("./article");
exports.root = new index_1.Router();
exports.root.xmt_common(function root_COMMON_1(request, response, next) {
console.log("root COMMON task 1");
return next();
});
exports.root.xmt_get(function root_GET_1(request, response, next) {
console.log("root GET method 1");
return next();
});
exports.root.xmt_mount("/article", article_1.article);
exports.root.xmt_all(function root_ALL_1(request, response, next) {
console.log("root ALL method 1");
return next();
});
exports.root.xmt_mount("/user", user_1.user);
exports.root.xmt_get(function root_GET_2(request, response, next) {
console.log("root GET method 2");
return next();
});
exports.root.xmt_post(function root_POST_1(request, response, next) {
console.log("root POST method 1");
return next();
});
exports.root.xmt_post(function root_POST_2(request, response, next) {
console.log("root POST method 2");
return next();
});
exports.root.xmt_common(function root_COMMON_2(request, response, next) {
console.log("root COMMON task 2");
response.xmt_setStatus(200);
response.xmt_send("Hello World");
return next();
});
exports.root.xmt_listen(7777, function (error) {
if (error)
return console.log(error);
console.log("Listen on 7777...");
});
//# sourceMappingURL=root.js.map