Skip to content

Instantly share code, notes, and snippets.

@digimon1740
Created October 23, 2019 13:41
Show Gist options
  • Save digimon1740/573918aa952591b90cb05fc4e4cf5fb4 to your computer and use it in GitHub Desktop.
Save digimon1740/573918aa952591b90cb05fc4e4cf5fb4 to your computer and use it in GitHub Desktop.
//before handlers
app.before(ctx -> {
// 모든 요청의 앞단에서 동작합니다.
});
app.before("/path/*", ctx -> {
// /path/* 로 시작하는 모든 요청의 앞단에서 동작합니다.
});
//endpoint handlers
app.get("/", ctx -> {
// 구현 로직
ctx.json(object);
});
app.get("/hello/*", ctx -> {
// hello/* 의 하위 경로에 대한 모든 요청을 받습니다.
});
//after handlers
app.after(ctx -> {
// 모든 요청의 뒷단에서 동작합니다.
});
app.after("/path/*", ctx -> {
// /path/* 로 시작하는 모든 요청의 뒷단에서 동작합니다.
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment