About · Used stack · How to use · License
A sample script that receives a name as an argument and proceeds to find all information and quotes of this character then insert all data in a database using graphQL.
To be able to run this project, first you will need to have in your machine:
- Composer to be able to manage the project's dependencies and autoload
- PHP on version ^8.1
- Git to be able to clone this repository
First clone the repository in your computer
- Cloning the repository
# Clone the repository
$ git clone https://github.com/Gabrielpatrola/game-of-thrones-api.git
# Go to the project folder
$ cd game-of-thrones-api/php
- Install the project's dependencies
# Installing
$ composer install
- Run the script
You will need to pass a name as an argument to be able to run this script, you only need to pass the first name of a character from the TV Show, If you pass more than one argument any argument after the first one will be ignored.
# passing Jon as an argument for the script
$ php index.php -n Jon
# If everything went ok it will show:
$ 'Character inserted in database'
- Show all data and delete all data
You can pass an argument called list
to show all stored data and delete
to remove all data from the database.
# Passing the list argument, it will show all sotred data
$ php index.php -n list
# Passing the delete, It will remove everything from the database
$ php index.php -n delete
First clone the repository in your computer
- Cloning the repository
# Clone the repository
$ git clone https://github.com/Gabrielpatrola/game-of-thrones-api.git
# Go to the project folder
$ cd game-of-thrones-api/js
- Install the project's dependencies
# Installing
$ npm install
- Run the script
You will need to pass a name as an argument to be able to run this script, you only need to pass the first name of a character from the TV Show, If you pass more than one argument any argument after the first one will be ignored.
# passing Jon as an argument for the script
$ node index.js Jon
# If everything went ok it will show:
$ 'Character inserted in database'
- Show all data and delete all data
You can pass an argument called list
to show all stored data and delete
to remove all data from the database.
# Passing the list argument, it will show all sotred data
$ node index.js list
# Passing the delete, It will remove everything from the database
$ node index.js delete
This project uses the MIT License. See the doc LICENSE for more details.
Made with 💙 by Gabriel "Patrola" Almeida.