Skip to content

natthphong/catalyst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Catalyst

Modern java framework api

maven

<dependency>
    <groupId>io.github.natthphong</groupId>
    <artifactId>catalyst</artifactId>
    <version>1.0.1</version>
</dependency>

simple server

CatalystServer server = CatalystServer.init();
server.get("/hello", ((req, res) -> res.send("hello")));
server.listen(8080);

middleware and afterResponse

server.middleware(((req, res, chain) -> {
    System.out.println("hello  chain");
    chain.next(req, res);
}));
server.afterResponse(((req, res, chain) -> {
    System.out.println("afterresponse");
    chain.next(req, res);
}));

group

GroupRoute api = server.group("/api/v1");
api.get("/hello", ((req, res) -> res.send("hello from group")));
api.middleware(((req, res, chain) -> {
    System.out.println("in group api");
    chain.next(req, res);
}));
api.afterResponse(((req, res, chain) -> {
    System.out.println("after Response");
    chain.next(req, res);
}));

About

Java framework build api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages