feat(server): add CORS support for extension HTTP routes
Enable CORS on the extension HTTP server to allow cross-origin requests from ATM apps and other web-based clients. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
de233b16c7
commit
2cac13b5a4
1 changed files with 2 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import 'dotenv/config'
|
import 'dotenv/config'
|
||||||
import express from 'express'
|
import express from 'express'
|
||||||
|
import cors from 'cors'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { fileURLToPath } from 'url'
|
import { fileURLToPath } from 'url'
|
||||||
import NewServer from '../proto/autogenerated/ts/express_server.js'
|
import NewServer from '../proto/autogenerated/ts/express_server.js'
|
||||||
|
|
@ -104,6 +105,7 @@ const start = async () => {
|
||||||
|
|
||||||
// Create Express app for extension HTTP routes
|
// Create Express app for extension HTTP routes
|
||||||
const extensionApp = express()
|
const extensionApp = express()
|
||||||
|
extensionApp.use(cors()) // Enable CORS for all origins (ATM apps, wallets, etc.)
|
||||||
extensionApp.use(express.json())
|
extensionApp.use(express.json())
|
||||||
|
|
||||||
// Mount extension HTTP routes
|
// Mount extension HTTP routes
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue