Giter Site home page Giter Site logo

kanye-api's Introduction

Application Setup and Testing

This document provides instructions on how to set up and test the application.

Table of Contents

Installation

Follow these steps to install the application:

  1. Clone the repository:

    git clone https://github.com/bcgru/kanye-api.git
  2. Navigate to the project directory:

    cd kanye-api
  3. Install the required dependencies using Composer:

    composer install

Running the Application

  • To run the application, execute the following command:

    php artisan serve

This will start a development server, and you can access the application in your browser at http://localhost:8000.

API Endpoints

The application provides the following API endpoints:

  • GET /api/quotes: Fetches 5 random Kayne West quotes.
  • GET /api/quotes/refresh: Refreshes the quotes and fetches the next 5 random quotes.

To access the API endpoints, you can use tools like CURL or HTTP clients like Postman. Please make sure to include the anonymous API token in the request headers.

Anonymous API Token

When accessing the /api/quotes and /api/quotes/refresh endpoints, you need to include the following anonymous API token in the request headers:

Authorization: my_anonymous_api_token

Make sure to include this token in the Authorization header of your HTTP requests to authenticate and access the API endpoints.

Example Usage

  • Here is an example of how you can use CURL to access the API endpoints:

    # Fetch 5 random Kayne West quotes
    curl -H "Authorization: my_anonymous_api_token" http://127.0.0.1:8000/api/quotes
    
    # Refresh and fetch the next 5 random quotes
    curl -H "Authorization: my_anonymous_api_token" http://127.0.0.1:8000/api/quotes/refresh
    

Feel free to explore and utilize these API endpoints to enhance your programming knowledge!

Running Tests

  • The application comes with a suite of unit and feature tests. To run the tests, use the following commands:

    php artisan test
    php artisan test --testsuite=Feature
    php artisan test --testsuite=Unit

This will execute all the tests and display the results in the console.

kanye-api's People

Contributors

avagru avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.