This app have npm dependencies. To install all dependencies, run
npm install;
You can set the environment variable PORT
to set the port
PORT=81 npm start
Set DO_NOT_OPEN
environment variable to start the server without
opening the browser
DO_NOT_OPEN=true npm start
Pass --production
flag to npm start
to run in production mode
npm start --production
To build the project for production use, run:
npm run build
This will build a new version of the web app, ready for production
Swagger Editor will make an XHR GET call to /config/defaults.json
to get it's settings before launch. If you are using Swagger Editor as a dependency or serving it statically, you can provide your own defaults.json
at this endpoint to override default settings.
Swagger Editor is configured with a file, defaults.json
.
Read the configuration guide and additional details
in defaults.json.guide.js
to learn how to configure Swagger Editor.
If you are familiar with Docker, a Dockerfile
is
provided.
Build an image named swagger-editor
sudo docker build -t swagger-editor .
Run the container, using the local port 8080 (you may change this to any available port).
sudo docker run -ti -p 8080:8080 swagger-editor
And open http://localhost:8080 in your browser
Code style is enforced by ESLint. Build will fail if changes in code is not following code style guildlines.
To run all tests run
npm test
This will build and run unit tests then if it was successful, it will run end-to-end tests.
All unit tests are located in ../test/unit
. Unit tests are written in Jasmine and run by Karma. To run unit tests, run
npm run unit-test
For developing unit tests, run
npm run unit-test-watch
This will keep test browser and test watcher open and watches for file changes to re-run tests.
All end-to-end tests are located in ../test/e2e
. To run end-to-end test, run
grunt protr
npm run e2e-test
This will run [Protractor](http://angular.github.io/protractor/#/) end-to-end test.