- To build and run tests:
make build test
- You would need to set up the following environment variables to run the app
(these need to correspond with the business Id that you use in the webapp):
- ASPNETCORE_ENVIRONMENT with a value of local
The app has three config files which are kept in src/StockportContentApi/app-config/
appsettings.json
- this is for generic application config.appsettings.{ASPNETCORE_ENVIRONMENT}.json
- this is for environment specific config, i.e. external service settings.injected/appsettings.{ASPNETCORE_ENVIRONMENT}.secrets.json
- this is for secret config, i.e. the Contentful space keys and access keys (template found here).
make run and then visit http://localhost:5001
make publish-app, this will package the app in release mode and output it into src/StockportContentApi/publish dir
- The Content Api acts as a translation layer between Contentful and the webapp.
https://cdn.contentful.com/spaces/SPACE_KEY/entries?access_token=ACCESS_TOKEN&content_type=CONTENT_TYPE
SPACE_KEY
: Corresponds to the contentful space keyACCESS_TOKEN
: Corresponds to the contentful space access tokenCONTENT_TYPE
: This relates to the content type that is stored within Contentful.
Both the SPACE_KEY
and ACCESS_TOKEN
are gained from the businessId specific app settings defined above. This allows for businessId specific data to be retrieved from Contentful.
This app runs using .Net Core SDK version 2.1.5.
Swagger is set up as an automated api documentation under /swagger/ui/index.html