https://github.com/imanilchaudhari/express-app
Demo app built in ExpressJS
https://github.com/imanilchaudhari/express-app
Last synced: 3 months ago
JSON representation
Demo app built in ExpressJS
- Host: GitHub
- URL: https://github.com/imanilchaudhari/express-app
- Owner: imanilchaudhari
- License: unlicense
- Created: 2023-05-30T11:39:48.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-05-31T10:21:40.000Z (about 2 years ago)
- Last Synced: 2025-01-13T15:33:19.602Z (5 months ago)
- Language: JavaScript
- Size: 116 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RESTfull API built with ExpressJS, MariaDB & MongoDB
[](https://travis-ci.org/imanilchaudhari/express-app)
Demo RESTfull API built with ExpressJS, MariaDB & MongoDB.
## Tech Stack
- Node.js 16
- NPM Libraries
- Nodemon for Debugging and keeping track of changed files
- Express for initiating the server
- Mongoose for interracting with MongoDB
- BodyParser to parse request body
- MySQL for interracting with MariDB
- MongoDB 4.0 (Docker container recommended)
- MariaDB 10.3 (Docker container recommended)## Walkthrough
### Set-up Docker (Recommended)
```
docker compose -f "docker-compose.yml" up -d --build
```### Starting the REST API Server
```
nodemon server.jsOR
npm start run
```### Import mysql table schema
Open adminer & create ```posts``` table in ```db_demo``` database. You can find the schema in [./resources/posts.sql](./resources/posts.sql)
### Create a sample post
```
curl -X POST \
http://localhost:3000/posts \
-H 'Accept: */*' \
-H 'Accept-Encoding: *' \
-H 'Content-Type: application/json' \
-H 'Host: localhost:3000' \
-d '{
"title" : "Post Title",
"content" : "Post content goes here."
}'
```## Reference
- [Codementor Tutorial](https://www.codementor.io/olatundegaruba/nodejs-restful-apis-in-10-minutes-q0sgsfhbd)