-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Demo app for 732
- Loading branch information
Showing
3 changed files
with
39 additions
and
36 deletions.
There are no files selected for viewing
35 changes: 0 additions & 35 deletions
35
coverage-report/src/test/java/org/jooby/issues/Issue732.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package redis; | ||
|
||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
import org.jooby.Jooby; | ||
import org.jooby.jedis.Redis; | ||
|
||
import com.typesafe.config.ConfigFactory; | ||
import com.typesafe.config.ConfigValueFactory; | ||
|
||
import redis.clients.jedis.Jedis; | ||
|
||
public class App732 extends Jooby { | ||
|
||
{ | ||
use(ConfigFactory.empty() | ||
.withValue("db", ConfigValueFactory.fromAnyRef("redis://localhost:6379"))); | ||
|
||
use(new Redis()); | ||
|
||
onStart(() -> { | ||
try (Jedis jedis = require(Jedis.class)) { | ||
jedis.set("foo", "bar"); | ||
} | ||
}); | ||
|
||
AtomicInteger inc = new AtomicInteger(); | ||
get("/", () -> { | ||
try (Jedis jedis = require(Jedis.class)) { | ||
return jedis.get("foo") + ":" + inc.incrementAndGet(); | ||
} | ||
}); | ||
} | ||
|
||
public static void main(final String[] args) { | ||
run(App732::new, args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters