Skip to content

Commit

Permalink
Merge pull request #69 from constantine2nd/develop
Browse files Browse the repository at this point in the history
Enable API Explorer II for OBP API split portal/API mode
  • Loading branch information
simonredfern authored Nov 25, 2024
2 parents 2e33abf + 5251b51 commit f061788
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
VITE_OBP_API_HOST=https://apisandbox.openbankproject.com

### OBP-API mode ###################################
# If OBP-API split to two instances, eg: apis,portal
# Then API_Explorer need to set two api hosts: api_hostname and this api_portal_hostname, for all Rest Apis will call api_hostname
# but for all the portal home page link, we need to use this props. If do not set this, it will use api_hostname value instead.
VITE_OBP_API_PORTAL_HOST=https://apisandbox.openbankproject.com
####################################################################################

VITE_OBP_API_VERSION=v5.1.0
VITE_OBP_API_MANAGER_HOST=https://apimanagersandbox.openbankproject.com
VITE_OBP_API_EXPLORER_HOST=http://localhost:5173
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "api-explorer",
"version": "1.0.22",
"version": "1.0.23",
"private": true,
"scripts": {
"dev": "vite & ts-node server/app.ts",
Expand Down
3 changes: 2 additions & 1 deletion server/middlewares/OauthRequestTokenMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export default class OauthRequestTokenMiddleware implements ExpressMiddlewareInt
constructor(private oauthInjectedService: OauthInjectedService) {}

use(request: Request, response: Response): any {
const apiHost = process.env.VITE_OBP_API_HOST
const apiHost = process.env.VITE_OBP_API_PORTAL_HOST || process.env.VITE_OBP_API_HOST;
console.debug('OauthRequestTokenMiddleware - API Host:', apiHost);
const oauthService = this.oauthInjectedService
const consumer = oauthService.getConsumer()
consumer.getOAuthRequestToken((error: any, oauthTokenKey: string, oauthTokenSecret: string) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/HeaderNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { obpApiActiveVersionsKey, obpGroupedMessageDocsKey, obpMyCollectionsEndp

const route = useRoute()
const router = useRouter()
const obpApiHost = ref(import.meta.env.VITE_OBP_API_HOST)
const obpApiHost = ref(import.meta.env.VITE_OBP_API_PORTAL_HOST || import.meta.env.VITE_OBP_API_HOST);
const obpApiManagerHost = ref(import.meta.env.VITE_OBP_API_MANAGER_HOST)
const loginUsername = ref('')
const logoffurl = ref('')
Expand Down

0 comments on commit f061788

Please sign in to comment.