I having a problem in trying to implement express-subdomain. I can be a problem or it is not clear to me what is going on.
I have my routes in a separate file and I am importing to the server file, it works fine, but when I try to use express-subdomain it's not working.
server.js
const subdomain = require('express-subdomain')
const cors = require('cors')
require('./database')
const port = process.env.PORT || 5003
const app = express()
app.use(cors())
app.use(express.json())
const routes = require('./routes')
app.use(subdomain('api',routes))
app.listen(port, () => console.log(`Server running on port ${port}`))
I having a problem in trying to implement
express-subdomain
. I can be a problem or it is not clear to me what is going on. I have my routes in a separate file and I am importing to the server file, it works fine, but when I try to useexpress-subdomain
it's not working.server.js
routes.js
I really need help with this. I am new with programing so, please be patient.