Getting Started
It’s very easy to get started with
Restlight
!Create a Spring Boot application and add dependency
Note:
netty
4.1.56.Final andtcnative
2.0.35.Final are directly dependent on.
Note: Please make sure the version of
tcnative
matches the version ofnetty
.
<dependency>
<groupId>io.esastack</groupId>
<artifactId>restlight-starter</artifactId>
<version>${mvn.version}</version>
</dependency>
Write your Controller
@RestController
@SpringBootApplication
public class RestlightDemoApplication {
@GetMapping("/hello")
public String hello() {
return "Hello Restlight!";
}
public static void main(String[] args) {
SpringApplication.run(RestlightDemoApplication.class, args);
}
}
Run your application and then you would see something like
Started Restlight server in 1265 millis on 0.0.0.0:8080
curl http://localhost:8080/hello
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified March 10, 2022: introduce docsy as the website framework and add docs-v1.0.0 (#120) (79630ff)