Skip to content

Commit

Permalink
Fix CORS error
Browse files Browse the repository at this point in the history
  • Loading branch information
acekyd committed Aug 19, 2024
1 parent 6237b76 commit 4ff9d54
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,17 @@ Configuration can be set using environment variables. Defaults are set in `src/c
- NGN to KES
- KES to USD
- USD to KES

- KES to USDC
- KES to USD
- NGN to GHS
- BTC to NGN

- USD to EUR
- EUR to USD
- USD to GBP
- USD to BTC

- EUR to USD
- EUR to USDC
- USD to EUR
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@web5/dids": "1.1.1",
"ajv": "8.12.0",
"cborg": "^3.0.0",
"cors": "^2.8.5",
"dotenv": "16.3.1",
"express": "4.19.2",
"fuzzysort": "^2.0.4",
Expand Down
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { requestCredential } from './credential-issuer.js'
import { NextFunction } from 'express-serve-static-core'
import { InMemoryExchangesApi } from './exchanges.js'
import express from 'express'
import cors from 'cors'

console.log('"AquaFinance Capital" launched: ', config.pfiDid[0].uri)
console.log('"SwiftLiquidity Solutions" launched: ', config.pfiDid[1].uri)
Expand Down Expand Up @@ -226,6 +227,9 @@ const issuerPort = 3001

issuerApi.use(snooper())

// Allow cross-origin requests
issuerApi.use(cors())

issuerApi.get('/', (req, res) => {
res.send(
'Please make a get request to /kcc?name=yourname&country=yourcountry&did=yourdid to get a credential',
Expand Down

0 comments on commit 4ff9d54

Please sign in to comment.