Skip to content

Commit

Permalink
docs: swager docs routing
Browse files Browse the repository at this point in the history
  • Loading branch information
shodown96 committed Oct 13, 2023
1 parent df55137 commit a8c3231
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 17 deletions.
30 changes: 29 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,40 @@
"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,
"skipCi": true,
"repoType": "github",
"repoHost": "https://github.com",
"projectName": "Mocked-API",
"projectOwner": "ageddesi"
"projectOwner": "ageddesi",
"commitType": "docs"
}
57 changes: 57 additions & 0 deletions .github/workflows/main_mockedapiserver.yml
Original file line number Diff line number Diff line change
@@ -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: .
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![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-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

<p align="center" style="margin-bottom: 20px">
Expand Down Expand Up @@ -176,6 +176,11 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://christa-burch.com/"><img src="https://avatars.githubusercontent.com/u/16121690?v=4?s=100" width="100px;" alt="Christa"/><br /><sub><b>Christa</b></sub></a><br /><a href="https://github.com/ageddesi/Mocked-API/commits?author=cweave" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/bpvcode"><img src="https://avatars.githubusercontent.com/u/66181027?v=4?s=100" width="100px;" alt="Bruno Vilar"/><br /><sub><b>Bruno Vilar</b></sub></a><br /><a href="https://github.com/ageddesi/Mocked-API/commits?author=bpvcode" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/vitormcferreira"><img src="https://avatars.githubusercontent.com/u/50532101?v=4?s=100" width="100px;" alt="Vitor"/><br /><sub><b>Vitor</b></sub></a><br /><a href="https://github.com/ageddesi/Mocked-API/commits?author=vitormcferreira" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/PalaniappanC"><img src="https://avatars.githubusercontent.com/u/45911913?v=4?s=100" width="100px;" alt="Palaniappan"/><br /><sub><b>Palaniappan</b></sub></a><br /><a href="https://github.com/ageddesi/Mocked-API/commits?author=PalaniappanC" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="http://suppergerrie2.com"><img src="https://avatars.githubusercontent.com/u/15769860?v=4?s=100" width="100px;" alt="Suppergerrie2"/><br /><sub><b>Suppergerrie2</b></sub></a><br /><a href="https://github.com/ageddesi/Mocked-API/commits?author=suppergerrie2" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/dipushrestha"><img src="https://avatars.githubusercontent.com/u/36785868?v=4?s=100" width="100px;" alt="Dipendra Shrestha"/><br /><sub><b>Dipendra Shrestha</b></sub></a><br /><a href="https://github.com/ageddesi/Mocked-API/commits?author=dipushrestha" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
ENABLE_SWAGGER=true
8 changes: 7 additions & 1 deletion api/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
3 changes: 3 additions & 0 deletions api/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build]
command = "npm install && npm run build"
functions = "functions"
15 changes: 4 additions & 11 deletions api/src/modules/countries/data/provinces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
},
{
Expand Down
4 changes: 2 additions & 2 deletions marketing-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit a8c3231

Please sign in to comment.