Skip to content

Commit

Permalink
apps: Allow multiple routes (Closes: #567). (#571)
Browse files Browse the repository at this point in the history
* apps: Allow multiple routes (Closes: #567).

* apps: Workers should not have routes.
  • Loading branch information
andrewsomething authored Feb 1, 2021
1 parent 911ab94 commit b7ffd57
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
25 changes: 16 additions & 9 deletions digitalocean/app_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,6 @@ func appSpecComponentBase() map[string]*schema.Schema {
Elem: appSpecEnvSchema(),
Set: schema.HashResource(appSpecEnvSchema()),
},
"routes": {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: appSpecRouteSchema(),
},
},
"source_dir": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -335,6 +326,14 @@ func appSpecServicesSchema() *schema.Resource {
Schema: appSpecImageSourceSchema(),
},
},
"routes": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Elem: &schema.Resource{
Schema: appSpecRouteSchema(),
},
},
}

for k, v := range appSpecComponentBase() {
Expand Down Expand Up @@ -368,6 +367,14 @@ func appSpecStaticSiteSchema() *schema.Resource {
Optional: true,
Description: "The name of the document to use as the fallback for any requests to documents that are not found when serving this static site.",
},
"routes": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Elem: &schema.Resource{
Schema: appSpecRouteSchema(),
},
},
}

for k, v := range appSpecComponentBase() {
Expand Down
4 changes: 4 additions & 0 deletions digitalocean/resource_digitalocean_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,10 @@ resource "digitalocean_app" "foobar" {
routes {
path = "/"
}
routes {
path = "/foo"
}
}
}
}`
Expand Down

0 comments on commit b7ffd57

Please sign in to comment.