tomatau / fetchful

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fetchful

This is an educational application intended purely for testing API endpoints.

Clone this project to your machine and open the App.js.

The component has a method called performFetch, you can edit the fetch call inside this method to target any API endpoints you're working on.

  performFetch = () =>
    fetch('http://localhost:8000/my-endpoint', {
      method: 'POST',
      headers: {
        Authorization: 'Bearer MY-SECRET-TOKEN',
      },
      body: JSON.stringify({ test: 'data' }),
    });

This is a way to test how your endpoints behave in a full-stack website scenario.

When running, the webpage has a button for triggering the fetch request. The options passed into the fetch will be displayed on the page in JSON as well as any errors or response data.

Commands

  • npm start
  • npm test

About


Languages

Language:JavaScript 60.3%Language:HTML 27.0%Language:CSS 12.7%