willianjusten / api

Strapi API to our Ecommerce

Home Page:https://reactavancado.com.br/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DigitalOcean Referral Badge

React Avançado - Won Games API

This is the API to create the Won Games Store from React Avançado course.

Requirements

This project uses PostgreSQL, so, in order to make it working, install in your local machine or use Docker.

The configuration to the Database can be found on config/database.js

Development

After cloning this project, install the dependencies:

yarn install

And run using:

yarn develop

The urls to access are:

  • http://localhost:1337/admin - The Dashboard to create and populate data
  • http://localhost:1337/graphql - GraphQL Playground to test your queries

The first time to access the Admin you'll need to create an user.

Populate data

This project uses a /games/populate route in order to populate the data via GoG site. In order to make it work, follow the steps:

  • Go to Roles & Permissions > Public and make sure game:populate route is public available and the upload as well
  • With Strapi running run the following comand in your console:
$ curl -X POST http://localhost:1337/games/populate

# you can pass query parameters like:
$ curl -X POST http://localhost:1337/games/populate?page=2
$ curl -X POST http://localhost:1337/games/populate?search=simcity
$ curl -X POST http://localhost:1337/games/populate?sort=rating&price=free
$ curl -X POST http://localhost:1337/games/populate?availability=coming&sort=popularity

About

Strapi API to our Ecommerce

https://reactavancado.com.br/


Languages

Language:JavaScript 99.5%Language:Shell 0.5%