Merge pull request #98 from FlowiseAI/feature/cors

Feature/Allow CORS access
This commit is contained in:
Henry Heng 2023-05-13 00:36:21 +01:00 committed by GitHub
commit 8270707668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -66,10 +66,8 @@ export class App {
this.app.use(express.json({ limit: '50mb' }))
this.app.use(express.urlencoded({ limit: '50mb', extended: true }))
// Allow access from ui when yarn run dev
if (process.env.NODE_ENV !== 'production') {
this.app.use(cors({ credentials: true, origin: 'http://localhost:8080' }))
}
// Allow access from *
this.app.use(cors())
const upload = multer({ dest: `${path.join(__dirname, '..', 'uploads')}/` })