Skip to content

Commit

Permalink
Fix route ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
johnf committed Dec 21, 2023
1 parent 02d913d commit 2882886
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions cdk/bin/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const environments: Environment[] = [
account: '847483222616',
zoneName: 'nabu-stage.paradisec.org.au',
acmeValue: 'PM0DillUQGnKlpqsD9dmT-s8U6Jq7WeSPEKOrptZWQI',
cloudflare: 'catalog.nabu-stage.paradisec.org.au.cdn.cloudflare.net',
},
{
...globals,
Expand All @@ -30,6 +31,7 @@ const environments: Environment[] = [
account: '618916419351',
zoneName: 'nabu-prod.paradisec.org.au',
acmeValue: 'coAr3vAsNUwrReLqZAtAPgfcwvnqPCPovbyYTp791i8',
cloudflare: 'catalog.nabu-prod.paradisec.org.au.cdn.cloudflare.net',
},
];
const prod = environments.find((env) => env.env === 'prod');
Expand Down
3 changes: 2 additions & 1 deletion cdk/lib/app-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class AppStack extends cdk.Stack {
catalogBucket,
zone,
tempCertificate,
cloudflare,
} = appProps;

// ////////////////////////
Expand Down Expand Up @@ -406,7 +407,7 @@ export class AppStack extends cdk.Stack {
new route53.CnameRecord(this, 'CatalogRecord', {
recordName: 'catalog',
zone,
domainName: ssm.StringParameter.valueForStringParameter(this, '/usyd/resources/application-load-balancer/ingress/dns'),
domainName: cloudflare,
});

// ////////////////////////
Expand Down
1 change: 1 addition & 0 deletions cdk/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type Environment = {
readonly account: string,
readonly zoneName: string,
readonly acmeValue: string,
readonly cloudflare: string,
};

export type AppProps = Environment & {
Expand Down
12 changes: 9 additions & 3 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@
post 'exsite9' => 'collections#create_from_exsite9'
post 'spreadsheet' => 'collections#create_from_spreadsheet'
end
resources :items, except: %i[index show] do
resources :items, except: %i[index] do
member do
get :show
get 'ro-crate-metadata.json', to: 'items#show', as: 'rocrate', defaults: { format: :rocrate }
get :display
get :data
patch :inherit_details
Expand Down Expand Up @@ -76,6 +74,14 @@
end
end

resources :collections do
resources :items, only: %i[] do
member do
get 'ro-crate-metadata.json', to: 'items#show', as: 'rocrate', defaults: { format: :rocrate }
end
end
end

get '/repository/:collection_identifier' => 'repository#collection', :as => 'repository_collection'
get '/repository/:collection_identifier/:item_identifier' => 'repository#item', :as => 'repository_item'
get '/repository/:collection_identifier/:item_identifier/:essence_filename' => 'repository#essence',
Expand Down

0 comments on commit 2882886

Please sign in to comment.