From a8c323193ce245c7bc076f54747a3aa5181bf4f1 Mon Sep 17 00:00:00 2001 From: Elijah Soladoye Date: Fri, 13 Oct 2023 03:25:12 +0100 Subject: [PATCH] docs: swager docs routing --- .all-contributorsrc | 30 ++++++++++- .github/workflows/main_mockedapiserver.yml | 57 +++++++++++++++++++++ README.md | 7 ++- api/.env.example | 2 +- api/app.ts | 8 ++- api/netlify.toml | 3 ++ api/src/modules/countries/data/provinces.ts | 15 ++---- marketing-site/package.json | 4 +- 8 files changed, 109 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/main_mockedapiserver.yml create mode 100644 api/netlify.toml diff --git a/.all-contributorsrc b/.all-contributorsrc index 2b6b221a..b1bc95e1 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -446,6 +446,33 @@ "contributions": [ "code" ] + }, + { + "login": "PalaniappanC", + "name": "Palaniappan", + "avatar_url": "https://avatars.githubusercontent.com/u/45911913?v=4", + "profile": "https://github.com/PalaniappanC", + "contributions": [ + "code" + ] + }, + { + "login": "suppergerrie2", + "name": "Suppergerrie2", + "avatar_url": "https://avatars.githubusercontent.com/u/15769860?v=4", + "profile": "http://suppergerrie2.com", + "contributions": [ + "code" + ] + }, + { + "login": "dipushrestha", + "name": "Dipendra Shrestha", + "avatar_url": "https://avatars.githubusercontent.com/u/36785868?v=4", + "profile": "https://github.com/dipushrestha", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, @@ -453,5 +480,6 @@ "repoType": "github", "repoHost": "https://github.com", "projectName": "Mocked-API", - "projectOwner": "ageddesi" + "projectOwner": "ageddesi", + "commitType": "docs" } diff --git a/.github/workflows/main_mockedapiserver.yml b/.github/workflows/main_mockedapiserver.yml new file mode 100644 index 00000000..161931a7 --- /dev/null +++ b/.github/workflows/main_mockedapiserver.yml @@ -0,0 +1,57 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy Node.js app to Azure Web App - MockedAPIServer + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Node.js version + uses: actions/setup-node@v1 + with: + node-version: '18.x' + + - name: npm install, build, and test + run: | + cd api + npm install + npm run build --if-present + npm run test --if-present + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v2 + with: + name: node-app + path: . + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v2 + with: + name: node-app + + - name: 'Deploy to Azure Web App' + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'MockedAPIServer' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_4CDBE670B01E4899A27A3085FC82BD91 }} + package: . diff --git a/README.md b/README.md index c36beb6f..2580b3a2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -[![All Contributors](https://img.shields.io/badge/all_contributors-48-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-51-orange.svg?style=flat-square)](#contributors-)

@@ -176,6 +176,11 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Christa
Christa

📖 Bruno Vilar
Bruno Vilar

📖 Vitor
Vitor

💻 + Palaniappan
Palaniappan

💻 + + + Suppergerrie2
Suppergerrie2

💻 + Dipendra Shrestha
Dipendra Shrestha

💻 diff --git a/api/.env.example b/api/.env.example index b0bd1998..443f3ae7 100644 --- a/api/.env.example +++ b/api/.env.example @@ -6,4 +6,4 @@ SENTRY_DSN=https://23423423.ingest.sentry.io/234234 ENABLE_SENTRY=false ENABLE_RATE_LIMIT=false ENABLE_MORGAN_LOGGING=false -ENABLE_SWAGGER=false \ No newline at end of file +ENABLE_SWAGGER=true \ No newline at end of file diff --git a/api/app.ts b/api/app.ts index 95d9eecb..2432a360 100644 --- a/api/app.ts +++ b/api/app.ts @@ -49,6 +49,12 @@ app.get('/full-status', (req, res) => { app.use(cors()); // enabling CORS for all requests; -if (process.env.ENABLE_SWAGGER === 'true') initSwagger(app); // setup Swagger; +if (process.env.ENABLE_SWAGGER === 'true'){ + initSwagger(app); // setup Swagger; +} else { + app.get('/', (req, res) => { + res.status(200).send('Welcome to the Mocked API') + }) +} export default app; diff --git a/api/netlify.toml b/api/netlify.toml new file mode 100644 index 00000000..cb4071d2 --- /dev/null +++ b/api/netlify.toml @@ -0,0 +1,3 @@ +[build] + command = "npm install && npm run build" + functions = "functions" diff --git a/api/src/modules/countries/data/provinces.ts b/api/src/modules/countries/data/provinces.ts index b9ce6599..572c556a 100644 --- a/api/src/modules/countries/data/provinces.ts +++ b/api/src/modules/countries/data/provinces.ts @@ -2741,20 +2741,13 @@ const provincesList = [ { country: 'Nepal', provinces: [ + 'Koshi', + 'Madhesh', 'Bagmati', - 'Bheri', - 'Dhawalagiri', 'Gandaki', - 'Janakpur', - 'Karnali', - 'Kosi', 'Lumbini', - 'Mahakali', - 'Mechi', - 'Narayani', - 'Rapti', - 'Sagarmatha', - 'Seti', + 'Karnali', + 'Sudurpashchim', ], }, { diff --git a/marketing-site/package.json b/marketing-site/package.json index cec1a310..4f4ab50f 100644 --- a/marketing-site/package.json +++ b/marketing-site/package.json @@ -10,8 +10,8 @@ "astro": "astro" }, "devDependencies": { - "@astrojs/tailwind": "^1.0.0", - "astro": "^1.0.8", + "@astrojs/tailwind": "^5.0.0", + "astro": "^3.2.0", "sass": "^1.55.0" }, "dependencies": {