Node.js + Express backend for the Autimilezzz car information platform.
- Install dependencies:
npm install- Create
.envfile:
MONGODB_URI=your_mongodb_connection_string
PORT=5000- Start the server:
npm start- Root Directory:
backend - Build Command:
npm install - Start Command:
npm start - Environment: Node
Add these in Render dashboard:
MONGODB_URI- Your MongoDB Atlas connection string
GET /- Health checkGET /api/posts- Get all postsPOST /api/posts- Create new post
Get your connection string from MongoDB Atlas and add it to the environment variables.
Format: mongodb+srv://username:password@cluster.mongodb.net/dbname?retryWrites=true&w=majority