Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

tsarenkotxt/poc-spring-boot-dynamic-controller

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

POC Spring Boot dynamic Controller

This is a simple POC/draft of how to add a REST controller in Spring Boot at runtime

Get started

Run the Spring Boot application:

./mvnw spring-boot:run

Fetch all users:

curl http://localhost:8080/users/

Simple user REST API:

URL HttpMethod RequestParam PathVariable RequestBody ResponseBody Description
/users/ GET List(User) get all
/users GET id User get by id
/users POST User save
/users PUT id User update
/users PATCH id, nickName update nickName
/users/{id} DELETE id delete

How it's work ?

  1. The Controller generated by Byte Buddy in UserDynamicControllerGenerator.java
  2. The Controller registered to Spring MVC by RequestMappingHandlerMapping in UserDynamicControllerRegister.java

About

Simple POC/draft of how to add a REST controller in Spring Boot at runtime.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.