battlefield-stats-express
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "battlefield-stats-express", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A simple battlefield stats express middleware", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -12,15 +12,9 @@ # battlefield-stats-express | ||
```javascript | ||
var bfs = require('battlefield-stats-express'); | ||
// You can get a token at https://battlefieldtracker.com/site-api | ||
app.use('/api', bfs(YOUR_API_TOKEN)) | ||
``` | ||
Use the same url routes and parameters found at http://docs.trnbattlefield.apiary.io/ | ||
Now you can navigate to `yourhost/api/` and the rest of the url is proxied to battle-tracker's api using your api key. | ||
## Full example | ||
```javascript | ||
const express = require('express'); | ||
const battlefieldStats = require('battlefield-stats-express'); | ||
const app = express(); | ||
const bfs = battlefieldStats(YOUR_API_TOKEN); // obtained from https://battlefieldtracker.com/site-api | ||
// Get or use your key from https://battlefieldtracker.com/site-api` | ||
const bfs = battlefieldStats(YOUR_API_TOKEN); | ||
app.use('/api', bfs) | ||
@@ -30,4 +24,5 @@ app.listen(3000); | ||
Now you can see results when you navigate to: http://localhost:3000/api/Stats/DetailedStats?platform=3&displayName=Ravic | ||
Now you can see results when you navigate to http://localhost:3000/api/Stats/DetailedStats?platform=3&displayName=Ravic | ||
## API Docs | ||
For documentation use http://docs.trnbattlefield.apiary.io/ then replace `https://battlefieldtracker.com/bf1/api/` with `http://localhost:3000/api` | ||
@@ -34,0 +29,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3246
74