source files -> src/ folder
This commit is contained in:
1 parent
f006207112
commit
d25f4439fa
144 files changed
No files matched your search
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Created by tmshv on 01/03/15.
|
||||
*/
|
||||
|
||||
var route = require("koa-route");
|
||||
var router = require("./");
|
||||
|
||||
module.exports = function (app) {
|
||||
app.use(function *(next) {
|
||||
yield next;
|
||||
|
||||
if (404 != this.status) return;
|
||||
|
||||
this.status = 404;
|
||||
yield router.accepts({
|
||||
"text/html": router.index(),
|
||||
|
||||
"text/plain": function *() {
|
||||
this.type = "text/plain";
|
||||
this.body = "Page not found";
|
||||
},
|
||||
|
||||
"application/json": function *() {
|
||||
this.type = "application/json";
|
||||
this.body = {
|
||||
message: "Not Found"
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user