Skip to content

Commit

Permalink
🎨 format messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanecek committed Jul 2, 2024
1 parent e67b846 commit 18e28fc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 40 deletions.
75 changes: 36 additions & 39 deletions source/Stargate-API-Skeleton/StargateApplication.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -88,45 +88,42 @@ StargateApplication class >> stackTraceDumpExtension [
{ #category : 'private' }
StargateApplication class >> stargateConfigurationParameters [

^ OrderedCollection new
add: (MandatoryConfigurationParameter
named: 'Public URL'
describedBy:
'Public URL where the API is deployed. Used to create hypermedia links'
inside: self sectionsForStargateConfiguration
convertingWith: #asUrl);
add: (MandatoryConfigurationParameter
named: 'Port'
describedBy: 'Listening port'
inside: self sectionsForStargateConfiguration
convertingWith: #asNumber);
add: (MandatoryConfigurationParameter
named: 'Operations Secret'
describedBy: 'Secret key for checking JWT signatures'
inside: self sectionsForStargateConfiguration
convertingWith: #asByteArray) asSensitive;
add: (OptionalConfigurationParameter
named: 'Log Incoming HTTP Requests'
describedBy:
'Boolean that indicates whether to log all the Incoming HTTP Requests'
inside: self sectionsForStargateConfiguration
defaultingTo: false
convertingWith: [ :value | value = 'true' ]);
add: (OptionalConfigurationParameter
named: 'Log Outgoing HTTP Requests'
describedBy:
'Boolean that indicates whether to log all the Outgoing HTTP Requests'
inside: self sectionsForStargateConfiguration
defaultingTo: false
convertingWith: [ :value | value = 'true' ]);
add: ( OptionalConfigurationParameter
named: 'Concurrent Connections Threshold'
describedBy:
'Set the maximum number of concurrent connections that I will accept. When this threshold is reached, a 503 Service Unavailable response will be sent and the connection will be closed'
inside: self sectionsForStargateConfiguration
defaultingTo: 32
convertingWith: #asNumber );
yourself
^ OrderedCollection new
add: ( MandatoryConfigurationParameter
named: 'Public URL'
describedBy: 'Public URL where the API is deployed. Used to create hypermedia links'
inside: self sectionsForStargateConfiguration
convertingWith: #asUrl );
add: ( MandatoryConfigurationParameter
named: 'Port'
describedBy: 'Listening port'
inside: self sectionsForStargateConfiguration
convertingWith: #asNumber );
add: ( MandatoryConfigurationParameter
named: 'Operations Secret'
describedBy: 'Secret key for checking JWT signatures'
inside: self sectionsForStargateConfiguration
convertingWith: #asByteArray ) asSensitive;
add: ( OptionalConfigurationParameter
named: 'Log Incoming HTTP Requests'
describedBy: 'Boolean that indicates whether to log all the Incoming HTTP Requests'
inside: self sectionsForStargateConfiguration
defaultingTo: false
convertingWith: [ :value | value = 'true' ] );
add: ( OptionalConfigurationParameter
named: 'Log Outgoing HTTP Requests'
describedBy: 'Boolean that indicates whether to log all the Outgoing HTTP Requests'
inside: self sectionsForStargateConfiguration
defaultingTo: false
convertingWith: [ :value | value = 'true' ] );
add: ( OptionalConfigurationParameter
named: 'Concurrent Connections Threshold'
describedBy:
'Set the maximum number of concurrent connections that I will accept. When this threshold is reached, a 503 Service Unavailable response will be sent and the connection will be closed'
inside: self sectionsForStargateConfiguration
defaultingTo: 32
convertingWith: #asNumber );
yourself
]

{ #category : 'accessing' }
Expand Down
2 changes: 1 addition & 1 deletion source/Stargate-Model/HTTPBasedRESTfulAPI.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Class {
HTTPBasedRESTfulAPI class >> configuredBy: configuration installing: aRESTfulControllerCollection [

AssertionChecker enforce: [ aRESTfulControllerCollection notEmpty ] because: 'An API needs at least to expose one resource'.

^ self new initializeConfiguredBy: configuration installing: aRESTfulControllerCollection
]

Expand Down

0 comments on commit 18e28fc

Please sign in to comment.