diff --git a/.changeset/nervous-pots-sort.md b/.changeset/nervous-pots-sort.md new file mode 100644 index 0000000..ed8dd6d --- /dev/null +++ b/.changeset/nervous-pots-sort.md @@ -0,0 +1,5 @@ +--- +"create-effect-app": minor +--- + +feat(template/monorepo/server): add dev and README instructions diff --git a/templates/monorepo/packages/cli/package.json b/templates/monorepo/packages/cli/package.json index 85000a5..3f843b2 100644 --- a/templates/monorepo/packages/cli/package.json +++ b/templates/monorepo/packages/cli/package.json @@ -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", diff --git a/templates/monorepo/packages/server/README.md b/templates/monorepo/packages/server/README.md index 7013a9d..a7c0942 100644 --- a/templates/monorepo/packages/server/README.md +++ b/templates/monorepo/packages/server/README.md @@ -1 +1,41 @@ -# Effect Monorepo Template - Server Package \ No newline at end of file +# 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 +```