golemcloud / golem

Golem: Transparent durable execution for any programming language

Home Page:https://learn.golem.cloud/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make subdomain optional in ApiDeployment

afsalthaj opened this issue · comments

This looks odd, and there must be some reason for why this hack was done. We can uncover it once we make subdomain optional.

impl Display for ApiSite {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        // Need to see how to remove the need of subdomain for localhost , as subdomains are not allowed for localhost
        let host = &self.host;
        if host.contains("localhost") || host.contains("127.0.0.1") {
            write!(f, "{}", self.host)
        } else {
            write!(f, "{}.{}", self.subdomain, self.host)
        }
    }

It doesn't need to be this way - that's for sure. Users should be able to simply host their API in localhost:9006, for example without worrying about domain and subdomain.