0.0.25 • Published 3 years ago

react-ncaa-data v0.0.25

Weekly downloads
28
License
MIT
Repository
github
Last release
3 years ago

react-ncaa-data

Put live (or old) NCAA data in your website!

NPM JavaScript Style Guide

Install

npm install --save react-ncaa-data

Usage

First you need to configure a proxy. I like to use express, so here is an example on how to set that up. This allows the NCAA react component to properly reroute fetch's to the NCAA casablanca server.

NOTE: this NCAA react component library defaults to '/ncaa_api' as shown below. If you use a different proxy api name....please make sure to set it accordingly.

const express = require('express');

const targetUrl = 'https://data.ncaa/com/';

app.use( '/ncaa_api',        // this is the 'proxy_api' setting
         createProxyMiddleware({
           target: targetUrl,
           changeOrigin: true,
           pathRewrite: {
             '^/ncaa_api/': '/'
           }
         })
);

Once you have your proxy configured, you can go ahead and import the NCAA context to use the data whereever you need to in your website.

import React, { Component } from 'react'

import { useNCAA } from 'react-ncaa-data'

class Example extends Component {
  const { 
  render() {
    return <MyComponent />
  }
}

License

MIT © flynneva

0.0.24

3 years ago

0.0.25

3 years ago

0.0.23

3 years ago

0.0.22

3 years ago

0.0.21

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.14

4 years ago

0.0.15

4 years ago

0.0.13

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago