Skip to content

MCherevichenko/NextJS-parser-app

Repository files navigation

Intro

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.

Tech

Installation

Docker is required

Docker installation guide

To configure and run application perform script

npm run bootstrap

This script will build and run Docker container, and apply migrations with data samples

If you want simply run the application perform

npm run docker:build

This script will build and run Docker container without data samples. If after that you want to apply data samples perform script

npm run db:configure

You can verify installation or change configuration of database by navigating to Hasura local console

About JSON

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"
  },
  ...
]

Endpoints to use

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors