A RESTful API backend for a blog platform built with Node.js, Express.js and PostgreSQL. This service provides endpoints for managing blog posts and authors with basic authentication.
Site is hosted on Railway and can be interacted with, using API testers like PostMan
- 📝 Blog post management (CRUD operations)
- 👥 Author management
- 📚 Swagger API documentation
- 🎯 Input validation middleware
- 📊 PostgreSQL database integration
- Node.js (v18 or higher recommended)
- PostgreSQL database
- npm or yarn package manager
- Express.js - Web framework
- PostgreSQL - Database
- cors - CORS middleware
- dotenv - Environment configuration
- swagger-ui-express - API documentation
- swagger-autogen - Swagger generation
You can access the Swagger API documentation at:
https://blog-backend-production-82fa.up.railway.app/api-docs
GET /posts- Get all blog postsGET /posts/:id- Get a specific blog postPOST /posts- Create a new blog postPATCH /posts/:id- Update a blog postDELETE /posts/:id- Delete a blog post
GET /authors- Get all authorsGET /authors/:id- Get a specific authorPOST /authors- Create a new authorDELETE /authors/:id- Delete an author