RandomIdeas

This is a REST API for sharing random ideas.

Usage

Install Dependencies

npm install

Back-end/Express Server

npm start

or

npm run dev (Nodemon)

Visit http://localhost:5000

Environment Variables

Add your MongoDB URI to the .env file.

MONGO_URI=your_mongodb_uri

REST Endpoints

Ideas

Endpoint Description Method Body
/api/ideas Get all ideas GET None
/api/ideas/:id Get idea by id GET None
/api/ideas Add idea POST { text, tag, username }
/api/ideas/:id Update idea PUT { text, tag, username }
/api/ideas/:id Delete idea DELETE username

When updating or deleting, the username must match the username of the idea creator.