https://github.com/maxime-hrt/ece-devops-lab4
https://github.com/maxime-hrt/ece-devops-lab4
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/maxime-hrt/ece-devops-lab4
- Owner: Maxime-Hrt
- Created: 2023-10-03T09:14:15.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-03T17:33:40.000Z (over 1 year ago)
- Last Synced: 2025-02-02T03:45:46.963Z (4 months ago)
- Language: JavaScript
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# User API web application
It is a basic NodeJS web application exposing REST API that creates and stores user parameters in [Redis database](https://redis.io/).
## Functionality
1. Start a web server
2. Create a user
2. Get a user## Installation
This application is written on NodeJS and it uses Redis database.
1. [Install NodeJS](https://nodejs.org/en/download/)
2. [Install Redis](https://redis.io/download)
3. Install application
Go to the root directory of the application (where `package.json` file located) and run:
```
npm install
```## Usage
1. Start a web server
From the root directory of the project run:
```
npm start
```It will start a web server available in your browser at http://localhost:3000.
2. Create a user
Send a POST (REST protocol) request using terminal:
```bash
curl --header "Content-Type: application/json" \
--request POST \
--data '{"username":"sergkudinov","firstname":"sergei","lastname":"kudinov"}' \
http://localhost:3000/user
```It will output:
```
{"status":"success","msg":"OK"}
```Another way to test your REST API is to use [Postman](https://www.postman.com/).
## Testing
From the root directory of the project, run:
```
npm test
```