Skip to content

Commit f061788

Browse files
authored
Merge pull request #69 from constantine2nd/develop
Enable API Explorer II for OBP API split portal/API mode
2 parents 2e33abf + 5251b51 commit f061788

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
VITE_OBP_API_HOST=https://apisandbox.openbankproject.com
2+
3+
### OBP-API mode ###################################
4+
# If OBP-API split to two instances, eg: apis,portal
5+
# Then API_Explorer need to set two api hosts: api_hostname and this api_portal_hostname, for all Rest Apis will call api_hostname
6+
# 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.
7+
VITE_OBP_API_PORTAL_HOST=https://apisandbox.openbankproject.com
8+
####################################################################################
9+
210
VITE_OBP_API_VERSION=v5.1.0
311
VITE_OBP_API_MANAGER_HOST=https://apimanagersandbox.openbankproject.com
412
VITE_OBP_API_EXPLORER_HOST=http://localhost:5173

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "api-explorer",
3-
"version": "1.0.22",
3+
"version": "1.0.23",
44
"private": true,
55
"scripts": {
66
"dev": "vite & ts-node server/app.ts",

server/middlewares/OauthRequestTokenMiddleware.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export default class OauthRequestTokenMiddleware implements ExpressMiddlewareInt
3535
constructor(private oauthInjectedService: OauthInjectedService) {}
3636

3737
use(request: Request, response: Response): any {
38-
const apiHost = process.env.VITE_OBP_API_HOST
38+
const apiHost = process.env.VITE_OBP_API_PORTAL_HOST || process.env.VITE_OBP_API_HOST;
39+
console.debug('OauthRequestTokenMiddleware - API Host:', apiHost);
3940
const oauthService = this.oauthInjectedService
4041
const consumer = oauthService.getConsumer()
4142
consumer.getOAuthRequestToken((error: any, oauthTokenKey: string, oauthTokenSecret: string) => {

src/components/HeaderNav.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import { obpApiActiveVersionsKey, obpGroupedMessageDocsKey, obpMyCollectionsEndp
4141
4242
const route = useRoute()
4343
const router = useRouter()
44-
const obpApiHost = ref(import.meta.env.VITE_OBP_API_HOST)
44+
const obpApiHost = ref(import.meta.env.VITE_OBP_API_PORTAL_HOST || import.meta.env.VITE_OBP_API_HOST);
4545
const obpApiManagerHost = ref(import.meta.env.VITE_OBP_API_MANAGER_HOST)
4646
const loginUsername = ref('')
4747
const logoffurl = ref('')

0 commit comments

Comments
 (0)