Random-Quote-Machine/README.md

39 lines
1.3 KiB
Markdown
Raw Normal View History

2022-06-29 18:22:24 +02:00
# Build a Random Quote Machine
2022-06-28 13:04:57 +02:00
2022-06-29 19:09:00 +02:00
**Demo:** [random-quote-machine.radii.page](https://random-quote-machine.radii.page/)
**Profile:** [https://www.freecodecamp.org/radii](https://www.freecodecamp.org/radii)
**Project specification:** [Build a Random Quote Machine](https://www.freecodecamp.org/learn/front-end-development-libraries/front-end-development-libraries-projects/build-a-random-quote-machine)
**[Tests](https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js)**
## Build and deploy as:
```{bash}
cd random-quote-machine
npm install
npm run build
cd ..
DOCKER_BUILDKIT=1 docker build -t radii/random-quote-machine:latest -f ./dockerfile ./random-quote-machine/build
docker run -p 8081:80 -it radii/random-quote-machine
```
Access WebApp at [http://localhost:8081](http://localhost:8081)
Note: you may replace `8081` with any other port number where you wish to make service available.
## Run tests as:
After building, go to to `build` sub-directory and edit `index.html` file and insert bellow code snippet immediately before closing `</body>` tag:
```{html}
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
```
Than serve as:
```{bash}
serve -s build
```
You should now see a hamburger on left of page. Tap/click it than select test suite `Random Quote Machine`. `Run Tests` and observe results.