typicode / hotel

🏩 A simple process manager for developers. Start apps from your browser and access them using local domains

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using subdomains and "Can't find server id: undefined" error

twigs67 opened this issue · comments

I'm attempting to use https via local signed cert, but I'm not figuring it out.

//.hotel/conf.json
{
  "port": 2000,
  "host": "127.0.0.1",
  "tld": "test", 
  "proxy": false
}

//servers/adonis-blog.json
{
  "cwd": "/Users/websites/adonis-blog",
  "cmd": "npm start",
  "env": {
    "PATH": "XXX",
    "PORT": 4000
  }
}


When I try to go to https://app.localhost.test I get the error "Can't find server id: undefined"

I was hoping someone might know how to handle this?

Does app.hotel.test work?

@j-f1
No, app.hotel.test brings me to the main hotel interface strangely enough. The only url that works is https://app.localhost:4000/.

Unfortunately, I can't get https to work with this url as it doesn't show a tld.

@twigs67 what if you try https://adonis-blog.test or https://subdomain.adonis-blog.test?

@typicode
I get the error page:

Error
Can't connect to server on PORT=4000

http://localhost:4000

Possible causes
Server crashed or timeout of 5000ms exceeded.
Server is not listening on PORT environment variable.
Try to reload or check logs.

Logs

> adonis-blog-demo@4.0.0 start /Users/AF/websites/adonis-blog
> node server.js

2018-10-03T22:23:24.522Z - �[32minfo�[39m: �[32mserving app on http://127.0.0.1:4000�[39m

It may be worth noting that my hosts file reads:

127.0.0.1       localhost.test
127.0.0.1       app.localhost

@j-f1 @typicode

I got it working @ http://adonis-blog.test but it won't work when a subdomain is added or under https.

For the subdomain, it seems that it doesn't register anything before adonis-blog as http://app.adonis-blog.test works, but when I add the subdomain in the server, http://app.adonis-blog.test produces HttpException: Route not found GET /

Also, I'm using my own self-signed cert, but I noticed that .hotel has it's own cert in it. Should I be using this instead?

For me the issue was with wrong server name. For accepting subdomains, I think you should keep the name as a regex to accept it.

hotel add --name "*.adonis-blog"  <other args>