This is a REST API for a blog with user authentication built using Next.js.
- Clone the repository
- Install dependencies:
npm install
- Set up environment variables in
.env.local
- Run the development server:
npm run dev
POST /api/auth/register
: Register a new userPOST /api/auth/login
: Log in a userGET /api/auth/logout
: Log out a userGET /api/auth/profile
: Get user profile
GET /api/posts
: Get all postsPOST /api/posts
: Create a new postGET /api/posts/:postId
: Get a single postPUT /api/posts/:postId
: Update a postDELETE /api/posts/:postId
: Delete a post