Created
August 19, 2021 21:33
-
-
Save kaz29/6109b422eb11676eaaf07ccacb101101 to your computer and use it in GitHub Desktop.
swagger-ui on Azure Static Web App example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ ! -d "$SOURCE_DIR/OUT" ];then | |
mkdir $SOURCE_DIR/out | |
fi | |
curl -OL https://petstore.swagger.io/v2/swagger.json --output swagger.json | |
cp node_modules/swagger-ui-dist/* $SOURCE_DIR/out/ | |
cp swagger.json $SOURCE_DIR/out/ | |
cp staticwebapp.config.json $SOURCE_DIR/out/ | |
sed -i "s|https://petstore.swagger.io/v2/swagger.json|swagger.json|g" $SOURCE_DIR/out/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "swagger-web", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"scripts": { | |
"build": "./bin/build" | |
}, | |
"dependencies": { | |
"swagger-ui-dist": "3.52.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"routes": [ | |
{ | |
"route": "/", | |
"allowedRoles": ["reader"] | |
}, | |
{ | |
"route": "/login", | |
"rewrite": "/.auth/login/github" | |
}, | |
{ | |
"route": "/.auth/login/twitter", | |
"statusCode": 404 | |
}, | |
{ | |
"route": "/logout", | |
"redirect": "/.auth/logout" | |
} | |
], | |
"responseOverrides": { | |
"401": { | |
"redirect": "/login", | |
"statusCode": 302 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment