Add support for setting alias when creatign instance. (#140)
* Add support for setting alias when creatign instance. The POST to create a instance now provides an `alias` field which then can be used to access the instance services through the following URL: `http://<alias>-<short_session>-<port>.<tld>` When creating a session you can now send an `alias` * Remove unnecessary function * Add alias support for DNS resolution
This commit is contained in:
2
api.go
2
api.go
@@ -65,6 +65,8 @@ func main() {
|
||||
// Specific routes
|
||||
r.Host(`{subdomain:.*}{node:pwd[0-9]{1,3}_[0-9]{1,3}_[0-9]{1,3}_[0-9]{1,3}}-{port:[0-9]*}.{tld:.*}`).Handler(tcpHandler)
|
||||
r.Host(`{subdomain:.*}{node:pwd[0-9]{1,3}_[0-9]{1,3}_[0-9]{1,3}_[0-9]{1,3}}.{tld:.*}`).Handler(tcpHandler)
|
||||
r.Host(`pwd{alias:.*}-{session:.*}-{port:[0-9]*}.{tld:.*}`).Handler(tcpHandler)
|
||||
r.Host(`pwd{alias:.*}-{session:.*}.{tld:.*}`).Handler(tcpHandler)
|
||||
r.HandleFunc("/ping", handlers.Ping).Methods("GET")
|
||||
corsRouter.HandleFunc("/instances/images", handlers.GetInstanceImages).Methods("GET")
|
||||
corsRouter.HandleFunc("/sessions/{sessionId}", handlers.GetSession).Methods("GET")
|
||||
|
||||
Reference in New Issue
Block a user