How to install Swagger on Ubuntu

15,256

Solution 1

  1. install node and npm, you just download node.tar.gz file,can scan node official website, https://nodejs.org/en/download/current/
  2. unrar this file,and set global parms for npm and node,if node -v and npm -v has result,it shows you succeed
  3. npm install -g http-server
  4. git clone https://github.com/swagger-api/swagger-editor.git
  5. http-server -p 8080 swagger-editor
  6. then you can access http:127.0.0.1:8080 view swagger!!! hope can help you !remember give me a good evaluation!

Solution 2

If you are using docker, simply pull and run the swaggerapi/swagger-editor

docker pull swaggerapi/swagger-editor
docker run -p 80:8080 swaggerapi/swagger-editor

Open your browser to http://localhost:80/

Share:
15,256

Related videos on Youtube

satheesh
Author by

satheesh

Updated on September 16, 2022

Comments

  • satheesh
    satheesh over 1 year

    I want to install Swagger on Ubuntu. I am new to swagger. I want to do some api documentation by using swagger. For that what are things i need to install on my machine? Please send me the information as soon as possible.

    • Helen
      Helen over 6 years
      Which one of the Swagger projects are you trying to install?
    • satheesh
      satheesh over 6 years
      i tried sudo also
  • bcag2
    bcag2 over 4 years
    As I have already lamp server running, I run container with: docker run -d -p 8080:8080 swaggerapi/swagger-editor to avoid error
  • rugby2312
    rugby2312 about 2 years
    If you want to pass an existing swagger.json to the container , remember to do the folder mapping and declare the file name as a variable docker run -d -p 8080:8080 -v /home/ubuntu/dswagger:/tmp -e SWAGGER_FILE=/tmp/swagger.json swaggerapi/swagger-editor