You can set the environment variable PORT to set the port
PORT=81 npm startThis app have npm and Bower dependencies. To install all dependencies in one line, run
npm i; bower iSimply run
grunt serveif you don't have grunt installed, you can run npm run develop instead.
You can also specify the port by setting PORT environment variable in development mode
PORT=3000 grunt serveor
PORT=3000 npm run developFor development it's preferred to have grunt installed globally on your machine.
To build the project just run:
grunt buildThis will build a new version of the web app, ready for production in /dist folder
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.
Read the configuration guide or take a look at defaults.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-editorAnd open http://localhost:8080 in your browser
Code style is enforced by JSCS (JavaScript Code Style) and JSHint. Build will fail if changes in code is not following code style guildlines.
To run all tests run
npm testThis 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
grunt karma:unitFor developing unit tests, run
grunt test-devThis 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 protrThis will run Protractor end-to-end test.