https://github.com/gautam-j/techtools-backend
REST API for TechTools using MongoDB, Express, Node.js
https://github.com/gautam-j/techtools-backend
express mongodb mongoose nodejs rest-api social-network
Last synced: 3 months ago
JSON representation
REST API for TechTools using MongoDB, Express, Node.js
- Host: GitHub
- URL: https://github.com/gautam-j/techtools-backend
- Owner: Gautam-J
- License: mit
- Created: 2020-12-08T17:24:23.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-16T11:29:52.000Z (almost 5 years ago)
- Last Synced: 2025-03-14T07:11:28.384Z (over 1 year ago)
- Topics: express, mongodb, mongoose, nodejs, rest-api, social-network
- Language: JavaScript
- Homepage:
- Size: 104 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TechTools-backend
REST API for TechTools using MongoDB, Express, Node.js
Hosted [here](https://salty-cove-54407.herokuapp.com/)
## Setup
- Add the following code snippet in `./config/default.json`
```json
{
"mongoURI": "yourMongoURI",
"jwtSecret": "yourSecretKey"
}
```
- `npm install` - Install all dependencies
- `npm start` - Run the API server
## Routes
### Testing
- GET - `/` - Return `"Hello World!"`
### User - `/api/users`
- POST - `/register` - Register new user
- POST - `/login` - Login user and return JSONWebToken
- GET - `/verify` - (Private) Verify user login and return User
- DELETE - `/delete` - (Private) Delete user
### Post - `/api/posts`
- POST - `/create` - (Private) Create a new post
- GET - `/index` - Get all posts
- GET - `/user/:id` - Get all posts by userId
- GET - `/type/:contentType` - Get all posts by contentType
- GET - `/:id` - Get post by Id
- PUT - `/:id` - (Private) Update post by Id
- DELETE - `/:id` - (Private) Delete post by Id
- PUT - `/like/:id` - (Private) Like post by Id
- PUT - `/unlike/:id` - (Private) Unlike post by Id
- POST - `/comment/:id` - (Private) Comment on a post by Id
- DELETE - `/uncomment/:id/:commentId` - (Private) Delete comment on post by Id