Introducing Quiz Server - server for quiz app
Features
- Creating user
- Login user
- Get user
- Update user
- todo++
Tech Stack
- Typescript
- Zod
- Express
- Drizzle-orm see
- Neon database (postgres)
pnpm install
pnpm db:generate
After generate sql file, you can copy sql file to your database and run it.
You can start the server using this command:
pnpm dev
Open http://localhost:3000 with your api tester like postman/insomnia to try the api.
@access Public @desc Register new user & set refreshToken and accessToken route POST /api/user/register body
{
"email": "[email protected]",
"name": "demo",
"password": "demo"
}
@access Public @desc Login user/set accessToken route POST /api/user/login body
{
"email": "[email protected]",
"password": "demo"
}
@access Public @desc Logout user/delete accessToken route POST /api/user/logout body none
@access Public @desc Refresh accessToken route GET /api/user/refresh
@access Private @desc Get user profile route GET /api/user/profile body none
@access Private @desc Update user name profile route PATCH /api/user/name body
{
"name": "demoupdate"
}
@access Private @desc Update user name profile route PATCH /api/user/password body
{
"password": "demoupdate"
}