Skip to content

Commit

Permalink
cli: fix env name for local dev
Browse files Browse the repository at this point in the history
The codegen and db connect functionality used inconsistent names
for the local development environment (the empty string and "dev" respectively).

Standardize on "local" for local development.
  • Loading branch information
eandre committed Apr 10, 2021
1 parent 8e6fcaa commit 331a525
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cli/daemon/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

// DBConnect starts the database and returns the DSN for connecting to it.
func (s *Server) DBConnect(ctx context.Context, req *daemonpb.DBConnectRequest) (*daemonpb.DBConnectResponse, error) {
if req.EnvName == "" {
if req.EnvName == "local" {
return s.dbConnectLocal(ctx, req)
}

Expand Down
2 changes: 1 addition & 1 deletion cli/internal/codegen/ts.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func (ts *ts) writeBaseClient() {
if (token !== undefined) {
this.headers["Authorization"] = "Bearer " + token
}
if (environment === "dev") {
if (environment === "local") {
this.baseURL = "http://localhost:4060/"
} else {
this.baseURL = ` + "`https://" + ts.appSlug + ".encoreapi.com/${environment}/`" + `
Expand Down
2 changes: 1 addition & 1 deletion cli/internal/codegen/ts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class BaseClient {
if (token !== undefined) {
this.headers["Authorization"] = "Bearer " + token
}
if (environment === "dev") {
if (environment === "local") {
this.baseURL = "http://localhost:4060/"
} else {
this.baseURL = ` + "`" + `https://app.encoreapi.com/${environment}/` + "`" + `
Expand Down

0 comments on commit 331a525

Please sign in to comment.