This backend replicates the core functionality of a popular blog website, built using Hono.js on Cloudflare Workers. It utilizes Prisma as the ORM and PostgreSQL as the database, with connection pooling enabled for optimal performance. JWT-based authorization is managed through middleware.
- Framework: Hono.js
- Platform: Cloudflare Workers
- ORM: Prisma
- Database: PostgreSQL
- Language: TypeScript
https://backend.keshav0kumar.workers.dev
- URL:
/api/v1/user/signup
- Method:
POST
- Description: Registers a new user account.
- Request Body:
{ "name": "string", "email": "string", "password": "string" }
- URL:
/api/v1/user/signin
- Method:
POST
- Description: Logins a user account.
- Request Body:
{ "email": "string", "password": "string" }
- URL:
api/v1/blog/create
- Method:
POST
- Description: Creates a new blog post.
- Middleware:
auth()
- RequiresAuthorization
header with JWT token. - Request Body:
{ "title": "string", "content": "string", "authorId": "string" }
- URL:
api/v1/blog/:id
- Method:
PUT
- Description: Edits a blog post.
- Middleware:
auth()
- RequiresAuthorization
header with JWT token. - Request Body:
{ "id": "string", "title": "string", "content": "string", "authorId": "string" }
- URL:
api/v1/blog/:id
- Method:
GET
- Description: Lists a blog post with the given id.
- Middleware:
auth()
- RequiresAuthorization
header with JWT token.
- URL:
api/v1/blog/all
- Method:
GET
- Description: Lists all blog posts.
- Middleware:
auth()
- RequiresAuthorization
header with JWT token.