Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/nervous-pots-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-effect-app": minor
---

feat(template/monorepo/server): add dev and README instructions
1 change: 1 addition & 0 deletions templates/monorepo/packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"directory": "dist"
},
"scripts": {
"dev": "tsx --watch src/server.ts",
"codegen": "build-utils prepare-v2",
"build": "pnpm build-esm && pnpm build-annotate && pnpm build-cjs && build-utils pack-v2",
"build-esm": "tsc -b tsconfig.build.json",
Expand Down
42 changes: 41 additions & 1 deletion templates/monorepo/packages/server/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
# Effect Monorepo Template - Server Package
# Effect Monorepo Template - Server Package

Run the `dev` script in `@template/server` package to start the server

The server will start on `http://localhost:3000` by default.

## TODOs API Endpoints

The server provides few endpoints

### Create a new TODO

```sh
curl -X POST http://localhost:3000/todos \
-H "Content-Type: application/json" \
-d '{"text": "my first effect todo"}'
```

### List all TODOs

```sh
curl -X GET http://localhost:3000/todos
```

### Get a specific TODO by ID

```sh
curl -X GET http://localhost:3000/todos/0
```

### Mark TODO completed

```sh
curl -X PATCH http://localhost:3000/todos/0
```

### Delete a specific TODO by ID

```sh
curl -X DELETE http://localhost:3000/todos/0
```