Skip to content

zhousujian/netty-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

netty-example

Example web server using Netty, inspired by Spark

Example

public class App {
    public static void main(final String[] args) throws Exception {
        new WebServer()

                // Simple GET request
                .get("/hello", (request, response) -> "Hello world")

                // Simple POST request
                .post("/hello", (request, response) -> {
                    return "Hello world: " + request.body();
                })

                // Start the server
                .start();
    }
}

About

Netty web project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages