express-subdomain
express-subdomain copied to clipboard
Subdomain not working with Glitch
Hey all. Say I have a Glitch express app - e.g. express.glitch.me
. My server.js has this piece of code:
var test = new express.Router()
test.get('/', (req, res) => {
res.send('Hello World!')
})
app.use(subdomain('api', test));
When I go to api.express.glitch.me
, I simply get Glitch's project-not-found page. I've also tried subdomain(api.express, test)
, and this doesn't work either. Any help?
This is a website specific problem. Glitch doesn't allow you to do what you're trying to do.
I'm not so sure. I'm trying to use this for an API subdomain too. Although my code is running on glitch for now, I am using a custom domain. Then when visiting a valid GET endpoint on the subdomain, it returns not found: api.[domain]
I have registered the subdomain as one of the custom domains, and DNS is setup correctly