diff --git a/backend/.env.example b/backend/.env.example index 54eca0f..6b54d15 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -1,3 +1,4 @@ +NODE_ENV=development MONGO_DB=mongodb://localhost:27017/urlMinify SECRET=secret AUTH_SECRET=secret \ No newline at end of file diff --git a/backend/index.js b/backend/index.js index 19d5556..c8f82fe 100644 --- a/backend/index.js +++ b/backend/index.js @@ -10,9 +10,15 @@ require('dotenv').config() const app = express() app.use(express.json()) -app.use(cors({ - origin: 'http://localhost:3000' -})); +app.use( + cors({ + origin: + process.env.NODE_ENV?.trim() === 'development' + ? // ? 'http://localhost:3000' + 'https://url-minify-git-fork-olaleye-blessing-fixurlminified-bravo68web.vercel.app' + : 'https://minfy.xyz', + }) +) app.use(json()) app.use(