{"id":21534145,"url":"https://github.com/milan-960/nodejs-swagger-api","last_synced_at":"2025-10-13T02:35:18.291Z","repository":{"id":231522974,"uuid":"611274109","full_name":"Milan-960/Nodejs-swagger-api","owner":"Milan-960","description":"Simple REST API on Nodejs server build using swagger-ui and ejs.","archived":false,"fork":false,"pushed_at":"2023-09-27T15:57:30.000Z","size":714,"stargazers_count":9,"open_issues_count":2,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T16:36:00.172Z","etag":null,"topics":["ejs","nodejs","reactjs","rest-api","swagger","swagger-ui","vercel"],"latest_commit_sha":null,"homepage":"https://nodejs-swagger-api.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Milan-960.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-03-08T13:43:26.000Z","updated_at":"2025-06-29T02:26:49.000Z","dependencies_parsed_at":"2024-04-04T12:59:59.613Z","dependency_job_id":"22d6b6ae-ffee-407f-b598-36b0b95c4f82","html_url":"https://github.com/Milan-960/Nodejs-swagger-api","commit_stats":null,"previous_names":["milan-960/nodejs-swagger-api"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Milan-960/Nodejs-swagger-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Milan-960%2FNodejs-swagger-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Milan-960%2FNodejs-swagger-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Milan-960%2FNodejs-swagger-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Milan-960%2FNodejs-swagger-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Milan-960","download_url":"https://codeload.github.com/Milan-960/Nodejs-swagger-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Milan-960%2FNodejs-swagger-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013999,"owners_count":26085345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ejs","nodejs","reactjs","rest-api","swagger","swagger-ui","vercel"],"created_at":"2024-11-24T03:09:15.494Z","updated_at":"2025-10-13T02:35:18.237Z","avatar_url":"https://github.com/Milan-960.png","language":"JavaScript","readme":"## Follow the steps below to create a RESTful server using swager!\n\n## Here is the Tree\n\n```\n ┣ 📂public\n ┣ 📂src\n ┃ ┣ 📂Data\n ┃ ┃ ┗ 📜data.js\n ┃ ┣ 📂Routes\n ┃ ┃ ┗ 📜posts.js\n ┃ ┣ 📂views\n ┃ ┃ ┣ 📂pages\n ┃ ┃ ┃ ┣ 📜index.css\n ┃ ┃ ┃ ┣ 📜index.ejs\n ┃ ┃ ┃ ┗ 📜log.jpeg\n ┃ ┃ ┣ 📂public\n ┃ ┃ ┃ ┗ 📜index.css\n ┃ ┃ ┗ 📜.DS_Store\n ┃ ┣ 📜.DS_Store\n ┃ ┗ 📜hello.js\n ┣ 📜.DS_Store\n ┣ 📜.babelrc\n ┣ 📜.gitignore\n ┣ 📜Readme.md\n ┣ 📜index.js\n ┣ 📜nodemon.json\n ┣ 📜now.json\n ┣ 📜package-lock.json\n ┣ 📜package.json\n ┗ 📜vercel.json\n```\n\n## Firstly let’s create a RESTful web server:\n\n## Navigate the cursor to the file I will create the project in the terminal and I am creating the package.json file with the following command:\n\n```\nnpm init --y\n```\n\n## Now let’s add the packages that are necessary to create the server:\n\n```\nnpm install express cors morgan body-parser dotenv\n```\n\n## let’s add the babel modules to the project:\n\n```\nnpm install @babel/core @babel/node @babel/preset-env\n```\n\n## let’s create the .babelrc file and add the following code:\n\n```\n{\n  “presets”: [“@babel/preset-env”]\n}\n```\n\n## And finally, let’s add the following code to scripts field in the package.json file.\n\n```\n\"start\": \"nodemon — exec babel-node src/index.js\"\n```\n\n### If you don’t have nodemon in your PC, I advise installing it globally.\n\n```\nsudo npm install -g nodemon\n```\n\n## Adding Swagger to the project\n\nFirstly, let’s install two modules that are necessary for documentation and user interface (UI):\n\n```\nnpm install swagger-jsdoc swagger-ui-express\n```\n\n## And I am importing these two modules in the index.js file:\n\n```\nimport swaggerUI from “swagger-ui-express”;\nimport swaggerJsDoc from “swagger-jsdoc”;\n```\n\n# \u0026#x1F34E; PS: If you have any other ideas about what can be improved please share your thoughts I would really appreciate that!\n\n\u003cimg align=\"right\" src=\"public/Home.png\" width=\"100%\"/\u003e\u0026nbsp;\n\u0026nbsp;\n\n\u003cimg align=\"right\" src=\"public/api-docs.png\" width=\"100%\"/\u003e\u0026nbsp;\n\u0026nbsp;\n\n## Nodejs server built and maintained by [Milan Sachani \u0026#x1F49C;](https://milansachani.dev)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilan-960%2Fnodejs-swagger-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilan-960%2Fnodejs-swagger-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilan-960%2Fnodejs-swagger-api/lists"}