Small web application that presents a simple REST API.
fizzbuzz/ --> root
build/ --> source files without flow annotations
src/ --> source files with flow annotations
fizzBuzz.js --> pure javascript code base
reports/ --> artillery reports are saved here
spec/ --> test location
fizzBuzzSpec.js --> test for code base
.babelrc --> cool stuff
.exlintrc --> style guide
.flowconfig --> configuration for static code analysis
.gitignore --> source control file
art.yml --> performance analysis config
package.json --> node config
README.txt --> please read me!
server.js --> node entry point, contains server setup
Node
$ git clone https://github.com/dabboxking/exercises/fizzbuzz.git
$ cd fizzbuzz
$ cd fizzbuzz
$ npm install
$ npm run dev
$ npm test
$ npm run test:watch
$ npm run lint
- Add "//@flow" to top of file you want to check
- Use the command below to check your file
$ npm run flow
Transform code during development
$ npm install babel-plugin-transform-flow-strip-types
$ babel --watch=./src --out-dir=./build
$ npm install -g artillery
$ npm run dev
$ npm run art
$ cd /reports
$ nsp check
3 vulnerabilities found (Regular Expression Denial of Service)
https://www.owasp.org/index.php/Top_10_2013-Top_10
$ curl -X GET "http://localhost:3000/api?word=fizz&max_value=30"
####via browser
- Open your favorite browser (EDGE)
- Go to http://localhost:3000/api?word=fizz&max_value=30