https://github.com/christian80gabi/todonodeapi
Todo Node.JS with TypeScript API
https://github.com/christian80gabi/todonodeapi
api-rest docker-compose express node-ts postgresql prisma typescript
Last synced: 11 days ago
JSON representation
Todo Node.JS with TypeScript API
- Host: GitHub
- URL: https://github.com/christian80gabi/todonodeapi
- Owner: christian80gabi
- License: mpl-2.0
- Created: 2023-04-02T10:35:11.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-13T15:06:17.000Z (about 1 year ago)
- Last Synced: 2025-10-06T11:40:21.899Z (5 months ago)
- Topics: api-rest, docker-compose, express, node-ts, postgresql, prisma, typescript
- Language: TypeScript
- Homepage:
- Size: 31.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Todo Node API
Todo Node.JS API using TypeScript and Prima
- TypeScript 5.x
- Prima 4.x
## # Init
Create an `.env` file in the root directory. Drop the script below inside.
This is the configuration of the database PostgreSQL (`DATABASE URL`).
```env
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
DATABASE_URL="postgresql://postgres:password@localhost:5432/tododb?schema=public"
```
Then run the app with `npx ts-node src/index.ts` from the terminal.
## # Test
Under `test > src > index.ts`, there is a single method creating a user and retrieving and the users and their Tasks (TODOs) created from the database.