File tree Expand file tree Collapse file tree 3 files changed +24
-9
lines changed Expand file tree Collapse file tree 3 files changed +24
-9
lines changed Original file line number Diff line number Diff line change 1
- # Elysia with Bun runtime
1
+ # Example: Ad Server using Bun, ElysiaJS, and Dragonfly
2
+
3
+ ## Packages Used
4
+
5
+ - [ ElysiaJS] ( https://elysiajs.com/ ) is a TypeScript framework supercharged by the [ Bun] ( https://bun.sh/ ) runtime with end-to-end type safety.
6
+ - [ ioredis] ( https://github.com/redis/ioredis ) is a Redis client for Node.js that can be used to interact with Dragonfly.
7
+ - [ typebox] ( https://github.com/sinclairzx81/typebox ) is a JSON schema type builder and validator with static type resolution for TypeScript.
8
+
9
+ ## Local Setup
10
+
11
+ - Make sure that you have [ Bun v1.0.6+] ( https://bun.sh/ ) installed locally.
12
+ - Make sure that you have [ Docker] ( https://docs.docker.com/engine/install/ ) installed locally.
13
+
14
+ ## Run Dragonfly & Service Application
15
+
16
+ - Run a Dragonfly instance using Docker:
2
17
3
- ## Getting Started
4
- To get started with this template, simply paste this command into your terminal:
5
18
``` bash
6
- bun create elysia ./elysia-example
19
+ docker run -p 6379:6379 --ulimit memlock=-1 docker.dragonflydb.io/dragonflydb/dragonfly
7
20
```
8
21
9
- ## Development
10
- To start the development server run:
22
+ - Install dependencies and run the service application:
23
+
11
24
``` bash
12
- bun run dev
25
+ # within the root directory of this example (dragonfly-examples/ad-server-cache-bun)
26
+ bun install
27
+ bun run dev # (or `bun dev`)
13
28
```
14
29
15
- Open http://localhost:3000/ with your browser to see the result.
30
+ - The ad server API would be running on ` http://localhost:3000/ `
Original file line number Diff line number Diff line change @@ -37,5 +37,5 @@ const app = new Elysia()
37
37
. listen ( 3000 ) ;
38
38
39
39
console . log (
40
- `🦊 Elysia is running at ${ app . server ?. hostname } :${ app . server ?. port } `
40
+ `Ad server API is running at ${ app . server ?. hostname } :${ app . server ?. port } `
41
41
) ;
You can’t perform that action at this time.
0 commit comments