Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bowbahdoe/microhttp-redirect
Utility for producing a redirect response
https://github.com/bowbahdoe/microhttp-redirect
Last synced: 7 days ago
JSON representation
Utility for producing a redirect response
- Host: GitHub
- URL: https://github.com/bowbahdoe/microhttp-redirect
- Owner: bowbahdoe
- License: apache-2.0
- Created: 2023-11-21T04:23:37.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-04-20T16:14:44.000Z (7 months ago)
- Last Synced: 2024-04-20T17:57:53.873Z (7 months ago)
- Language: Java
- Size: 74.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# microhttp-redirect
Utility for producing a redirect response.
## Dependency Information
### Maven
```xml
dev.mccue
microhttp-redirect
2024.04.20```
### Gradle
```groovy
dependencies {
implementation('dev.mccue:microhttp-redirect:2024.04.20')
}
```## Usage
```java
import dev.mccue.microhttp.handler.IntoResponse;
import dev.mccue.microhttp.handler.RouteHandler;
import org.microhttp.Request;import java.util.regex.Matcher;
import java.util.regex.Pattern;public class SomeHandler extends RouteHandler {
public SomeHandler() {
super("GET", Pattern.compile("/some/path"));
}@Override
protected IntoResponse handleRoute(Matcher matcher, Request request) {
return RedirectResponse.seeOther("/path/to/redirect/to");
}
}
```