1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-09 15:30:05 +00:00

chore: docker configured for development api+web+mongodb

This commit is contained in:
Saad Jutt
2021-11-14 09:03:38 +05:00
parent d5024012c4
commit 4792f15c40
9 changed files with 62 additions and 27 deletions

View File

@@ -13,8 +13,8 @@ dotenv.config()
const app = express()
const { MODE } = process.env
if (MODE?.trim() !== 'server') {
const { MODE, CORS } = process.env
if (MODE?.trim() !== 'server' || CORS?.trim() === 'enable') {
console.log('All CORS Requests are enabled')
app.use(cors({ credentials: true, origin: 'http://localhost:3000' }))
}
@@ -27,6 +27,10 @@ app.use('/', webRouter)
app.use('/SASjsApi', apiRouter)
app.use(express.json({ limit: '50mb' }))
app.use(express.static(getWebBuildFolderPath()))
try {
app.use(express.static(getWebBuildFolderPath()))
} catch (err) {
console.error('Unable to get web build')
}
export default connectDB().then(() => app)