https://github.com/abendayan/web
https://github.com/abendayan/web
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/abendayan/web
- Owner: abendayan
- Created: 2018-05-27T16:17:00.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T06:25:12.000Z (over 3 years ago)
- Last Synced: 2025-03-02T08:33:22.678Z (over 1 year ago)
- Language: JavaScript
- Size: 324 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Authors
Adele Bendayan 336141056
Or Soffer 311119671
Eti Yanay 312118599
## How to install
* Install the dependencies by running in the root folder:
npm install
## Calculator
### Display logic
As the example on the exercise, it will always display the last number.
For example, if the last entry was "2+34", it will display 34.
Supports: +, -, * , /
### Testing
In the terminal, write:
mocha
## Web Server
### Instruction
1. run the server.js (listens on port 3000): In the terminal run:
node server.js
2. run through the terminal (in the place YOUR_INPUT, write your input):
curl http://localhost:3000/calculate -X POST -H 'content-type: application/json' -d '{"calculatorState": null, "input": }'
Other option: run through the browser 'http://localhost:3000/' and after each input, press "submit".
### Integration Test
In the terminal, write:
npm test
## Docker
### DockerFile
#### Build instruction
Run:
docker build -t web/node-web-app .
#### Running instruction
Run:
docker run -p 49160:3000 -d web/node-web-app
The website is now accessible at: http://localhost:49160
Like previously, it can be tested using curl with:
curl http://localhost:49160/calculate -X POST -H 'content-type: application/json' -d '{"calculatorState": null, "input": }'
### Docker-Compose
Run:
docker-compose build
docker-compose up