Our company is using swagger to document their API's, currently a couple of developers are using the online swagger editor on their PC's.
I want to move this piece of the design process into our standard development environment, which is in a walled garden without internet access.
How do I go about installing npm and the swagger editor in an offline environment?
There are options to use either RHEL or Windows machines, although Windows is preferable as developers have local admin rights
npm
is not required, you can download the compiled files from the Swagger Editor repository:
and open index.html
locally (from the file system) or put the files onto a web server in your network.
In short answer is https://swagger.io/docs/swagger-tools/#swagger-editor
git clone https://github.com/swagger-api/swagger-editor.git
cd swagger-editor
npm install
npm run build
npm start
And it will works in your Intranet OK.
- Download the one of the source releases from swagger-editor's github page (click releases link on the page)
- unzip the downloaded source release zip/tar file.
- cd into the extracted source dir, type 'npm install' (or if you have some npm mirror module installed, such as cnpm, use 'cnpm install' instead)
- Use a browser to open index.html file in the source dir. Or, follow official guide the 'Setup with http-server module from GitHub' section to serve from a local static web server.
PS. You don't need to build the source code unless you want to contribute as written in the 'Contribute' section of the official document.
With one command with npm/npx:
npx swagger-editor-binary