This is a Next application, which gets tail parameter from URL string, then make request to Postgres via GraphQL query and receive object id. After that application parse JSON-file for object with the same id as received from database.
Docker is required
To configure and run application perform script
npm run bootstrapThis script will build and run Docker container, and apply migrations with data samples
If you want simply run the application perform
npm run docker:buildThis script will build and run Docker container without data samples. If after that you want to apply data samples perform script
npm run db:configureYou can verify installation or change configuration of database by navigating to Hasura local console
The application is configured so that the JSON file should be placed in public folder
To change the destination, edit fileUrl variable in next.config.js file
Example of JSON structure:
[
{
"id": 1,
"title": "Hello",
"description": "World"
},
...
]There is one usable endpoint: http://localhost:3000/{tail}
Where {tail} is passed string parameter, for example http://localhost:3000/best-hello-ever
Also you can access Hasura console on http://localhost:8080/console