Skip to content

Commit 205e7bf

Browse files
authored
feat(template/monorepo/server): add dev and README instructions (#94)
1 parent 0aed723 commit 205e7bf

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

.changeset/nervous-pots-sort.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-effect-app": minor
3+
---
4+
5+
feat(template/monorepo/server): add dev and README instructions

templates/monorepo/packages/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"directory": "dist"
1515
},
1616
"scripts": {
17+
"dev": "tsx --watch src/server.ts",
1718
"codegen": "build-utils prepare-v2",
1819
"build": "pnpm build-esm && pnpm build-annotate && pnpm build-cjs && build-utils pack-v2",
1920
"build-esm": "tsc -b tsconfig.build.json",
Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,41 @@
1-
# Effect Monorepo Template - Server Package
1+
# Effect Monorepo Template - Server Package
2+
3+
Run the `dev` script in `@template/server` package to start the server
4+
5+
The server will start on `http://localhost:3000` by default.
6+
7+
## TODOs API Endpoints
8+
9+
The server provides few endpoints
10+
11+
### Create a new TODO
12+
13+
```sh
14+
curl -X POST http://localhost:3000/todos \
15+
-H "Content-Type: application/json" \
16+
-d '{"text": "my first effect todo"}'
17+
```
18+
19+
### List all TODOs
20+
21+
```sh
22+
curl -X GET http://localhost:3000/todos
23+
```
24+
25+
### Get a specific TODO by ID
26+
27+
```sh
28+
curl -X GET http://localhost:3000/todos/0
29+
```
30+
31+
### Mark TODO completed
32+
33+
```sh
34+
curl -X PATCH http://localhost:3000/todos/0
35+
```
36+
37+
### Delete a specific TODO by ID
38+
39+
```sh
40+
curl -X DELETE http://localhost:3000/todos/0
41+
```

0 commit comments

Comments
 (0)