A JavaScript (CommonJS) Express API with Prisma ORM. This is the JavaScript equivalent of the example-typescript project.
# Install dependencies
npm install
# Set up environment
cp env.example .env
# Edit .env with your database credentials
# Generate Prisma client
npx prisma generate
# Run database migrations
npx prisma migrate dev
# Start the server
npm start# Start with file watching (Node.js 18+)
npm run devGET /- Health checkPOST /api/users- RegisterPOST /api/users/login- LoginGET /api/user- Get current user (auth required)PUT /api/user- Update user (auth required)GET /api/profiles/:username- Get profilePOST /api/profiles/:username/follow- Follow user (auth required)DELETE /api/profiles/:username/follow- Unfollow user (auth required)GET /api/articles- List articlesGET /api/articles/feed- Get feed (auth required)POST /api/articles- Create article (auth required)GET /api/articles/:slug- Get articlePUT /api/articles/:slug- Update article (auth required)DELETE /api/articles/:slug- Delete article (auth required)GET /api/articles/:slug/comments- Get commentsPOST /api/articles/:slug/comments- Add comment (auth required)DELETE /api/articles/:slug/comments/:id- Delete comment (auth required)POST /api/articles/:slug/favorite- Favorite article (auth required)DELETE /api/articles/:slug/favorite- Unfavorite article (auth required)GET /api/tags- Get tags