Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/veresdavid/address-app
A small dockerized application, that can store users and their addresses.
https://github.com/veresdavid/address-app
docker docker-compose express mongodb nodejs
Last synced: 22 days ago
JSON representation
A small dockerized application, that can store users and their addresses.
- Host: GitHub
- URL: https://github.com/veresdavid/address-app
- Owner: veresdavid
- Created: 2019-08-23T20:31:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T03:04:41.000Z (about 2 years ago)
- Last Synced: 2023-02-28T14:34:20.618Z (almost 2 years ago)
- Topics: docker, docker-compose, express, mongodb, nodejs
- Language: JavaScript
- Size: 35.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Address App
A small dockerized application, that can store users and their addresses.## Tech stack
The tech stack consists of the following things:
* NodeJs
* Express
* MongoDB
* Mongoose
* Docker## How to start the app
To spin up the application, you have to type the following command in the root directory of this app:
```
docker-compose up
```## The running application
If you spin up the app, it runs the following docker services:
* A MongoDB instance on port 27017.
* A MongoDB Express app on port 8081. You can view your databases, collections and documents with this webapp.
* An Express-based REST API running on port 3000. This is the main application.## Endpoints
The application has several endpoints. These are the following:
* `GET /users` : lists all the saved users
* `GET /users/:userId` : gets a user with the given id
* `POST /users` : saves a new user based on the posted request body
* `PUT /users/:userId` : updates the user with the given id, to the data posted in the request body
* `DELETE /users/:userId` : deletes the user with the given id
* `GET /users/:userId/addresses` : lists all the addresses attached to the user with the given id
* `POST /users/:userId/addresses` : creates and/or attaches a new address to the user with the given id
* `GET /users/:userId/addresse/:addressId` : gets an address attached to a user with the given address and user id