remove unused test file
This commit is contained in:
parent
63bdc0d0ed
commit
953af4564b
36
src/test.mjs
36
src/test.mjs
@ -1,36 +0,0 @@
|
|||||||
import flummpress from '../dist/index.js';
|
|
||||||
|
|
||||||
process.on('unhandledRejection', err => {
|
|
||||||
console.error(err);
|
|
||||||
throw err;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
const app = new flummpress();
|
|
||||||
|
|
||||||
const loggedin = async (req, res, next) => {
|
|
||||||
console.log("Logged in");
|
|
||||||
await next();
|
|
||||||
};
|
|
||||||
|
|
||||||
app.router.group(/^\/api\/v2\/admin\/(?<postid>\d+)\/tags/, group => {
|
|
||||||
group.get(/$/,
|
|
||||||
(req, res, next) => { // middleware davor
|
|
||||||
console.log("Logged in");
|
|
||||||
next();
|
|
||||||
},
|
|
||||||
(req, res, next) => { // eigentlicher request
|
|
||||||
res.reply({
|
|
||||||
body: JSON.stringify(req.params)
|
|
||||||
});
|
|
||||||
next();
|
|
||||||
},
|
|
||||||
(req, res) => { // middleware danach
|
|
||||||
console.log("Logged out");
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
app.listen(3000);
|
|
||||||
|
|
||||||
console.log(app.router);
|
|
Loading…
x
Reference in New Issue
Block a user