Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/membrane/membrane-spring-boot-starter
A Spring Boot Starter for Membrane Service Proxy.
https://github.com/membrane/membrane-spring-boot-starter
embedded java java-8 reverse-proxy spring-boot spring-boot-starter standalone
Last synced: 28 days ago
JSON representation
A Spring Boot Starter for Membrane Service Proxy.
- Host: GitHub
- URL: https://github.com/membrane/membrane-spring-boot-starter
- Owner: membrane
- License: apache-2.0
- Created: 2017-05-11T13:07:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-18T20:23:32.000Z (over 7 years ago)
- Last Synced: 2024-03-26T20:08:15.026Z (10 months ago)
- Topics: embedded, java, java-8, reverse-proxy, spring-boot, spring-boot-starter, standalone
- Language: Java
- Homepage:
- Size: 162 KB
- Stars: 10
- Watchers: 11
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Membrane Spring Boot Starter
[![CircleCI](https://circleci.com/gh/membrane/membrane-spring-boot-starter.svg?style=shield&circle-token=8c730ac71f3736480b6b713ff86fe8b17a14cfa3)](https://circleci.com/gh/membrane/membrane-spring-boot-starter)
[![Release](https://jitpack.io/v/membrane/membrane-spring-boot-starter.svg)](https://jitpack.io/#membrane/membrane-spring-boot-starter)
[![Dependency Status](https://www.versioneye.com/user/projects/59147f67e1638f00500b4509/badge.svg?style=flat)](https://www.versioneye.com/user/projects/59147f67e1638f00500b4509)
[![codecov](https://codecov.io/gh/membrane/membrane-spring-boot-starter/branch/master/graph/badge.svg)](https://codecov.io/gh/membrane/membrane-spring-boot-starter)
[![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](https://raw.githubusercontent.com/membrane/membrane-spring-boot-starter/master/LICENSE)A Spring Boot Starter for [Membrane Service Proxy](https://github.com/membrane/service-proxy).
## Usage
Forward all `GET` requests starting with `/jokes` to [The Internet Chuck Norris Database API](http://www.icndb.com/api/).
```java
@EnableMembrane
@SpringBootApplication
public class Application {
@Bean
public Proxies proxies() {
return p -> p
.serviceProxy(s -> s
.matches(m -> m
.method(GET)
.pathPrefix("/jokes"))
.target(t -> t.host("api.icndb.com")));
}public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
```Test the configuration by performing a `GET` request.
```sh
$ curl http://localhost:8080/jokes/497
```The output should look similar to this.
```json
{
"type": "success",
"value": {
"id": 497,
"joke": "If Chuck Norris writes code with bugs, the bugs fix themselves.",
"categories": [
"nerdy"
]
}
}
```## Installation
### Maven
```xml
jitpack.io
https://jitpack.io
com.github.membrane
membrane-spring-boot-starter
0.6.0
```
### Gradle
```groovy
repositories {
maven { url 'https://jitpack.io' }
}dependencies {
compile 'com.github.membrane:membrane-spring-boot-starter:0.6.0'
}
```## Acknowledgements
Thanks [@snicoll](https://github.com/snicoll) for pointing out flaws in the auto-configuration!