This document outlines the API endpoints for the freeWriter application. These endpoints are implemented as serverless functions on Vercel.
All API requests should be prefixed with: https://your-vercel-app-url.vercel.app/api
Most endpoints require authentication. Include the JWT token in the Authorization header:
Authorization: Bearer YOUR_JWT_TOKEN
- POST
/api/users/register
- Body:
{ "username": "string", "email": "string", "password": "string", "writingMode": "Plotter" | "Pantser" }
- Response: JWT token
- POST
/api/users/login
- Body:
{ "email": "string", "password": "string" }
- Response: JWT token
- GET
/api/stories
- Response: Array of story objects
- POST
/api/stories/create
- Body:
{ "title": "string", "content": "string" }
- Response: Created story object
... (rest of the API documentation)