express-subdomain icon indicating copy to clipboard operation
express-subdomain copied to clipboard

Subdomain not working with Glitch

Open old-df38257622 opened this issue 4 years ago • 2 comments

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?

old-df38257622 avatar Mar 03 '20 01:03 old-df38257622

This is a website specific problem. Glitch doesn't allow you to do what you're trying to do.

Zaedus avatar May 30 '20 03:05 Zaedus

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

DeathHound6 avatar Jan 23 '21 17:01 DeathHound6