diff --git a/app/package.json b/app/package.json index f10f231..c7a617e 100644 --- a/app/package.json +++ b/app/package.json @@ -17,6 +17,7 @@ "main": "dist/index.js", "dependencies": { "archiver": "^7.0.1", + "cors": "^2.8.5", "dayjs": "^1.11.13", "dotenv": "^16.4.5", "ejs": "^3.1.10", diff --git a/app/src/index.ts b/app/src/index.ts index a5db9db..c42b6af 100644 --- a/app/src/index.ts +++ b/app/src/index.ts @@ -2,6 +2,7 @@ import express from 'express' import immich from './immich' import render from './render' import dayjs from 'dayjs' +import cors from 'cors' import { AssetType, ImageSize } from './types' import { decrypt } from './encrypt' import { log, toString, addResponseHeaders } from './functions' @@ -9,6 +10,8 @@ import { log, toString, addResponseHeaders } from './functions' require('dotenv').config() const app = express() +// Enable CORS +app.use(cors()) // Add the EJS view engine, to render the gallery page app.set('view engine', 'ejs') // For parsing the password unlock form