Skip to content
This repository has been archived by the owner on Dec 28, 2018. It is now read-only.

Commit

Permalink
Merge pull request #24 from SkYNewZ/develop
Browse files Browse the repository at this point in the history
* [Fix] change url and and remove anayltics support
* [Fix] try git tag to have correct tag name
* [Feature] tslint and [code prettier](https://github.com/prettier/prettier) on whole project
* [Fix] Error 500 on some test, so ignore waiting qlaffont/fortnite-api#48
  • Loading branch information
SkYNewZ authored Mar 31, 2018
2 parents 7681c2e + aeb43ae commit 54c87d8
Show file tree
Hide file tree
Showing 41 changed files with 1,307 additions and 1,834 deletions.
47 changes: 0 additions & 47 deletions .all-contributorsrc

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

7 changes: 0 additions & 7 deletions .eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ after_success:

before_deploy:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- git tag "$(cat VERSION)"

deploy:
- provider: releases
Expand Down
45 changes: 25 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,68 @@
# Fortnite-API on NodeJs Server

[![Build Status](https://travis-ci.org/SkYNewZ/rest-fornite-api.svg?branch=master)](https://travis-ci.org/SkYNewZ/rest-fornite-api)
[![codecov](https://codecov.io/gh/SkYNewZ/rest-fornite-api/branch/master/graph/badge.svg)](https://codecov.io/gh/SkYNewZ/rest-fornite-api)
[![Docker Pulls](https://img.shields.io/docker/pulls/skynewz/fortnite-api.svg)](https://hub.docker.com/r/skynewz/fortnite-api/)
[![](https://images.microbadger.com/badges/version/skynewz/fortnite-api.svg)](https://microbadger.com/images/skynewz/fortnite-api "Get your own version badge on microbadger.com")
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors)
![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/QLemaire/2)

A simple NodeJS API under docker container to retrieve stats and infos from [Fortnite Game](https://www.epicgames.com/fortnite/fr/home) API.
See on [Docker Hub](https://hub.docker.com/r/skynewz/fortnite-api/).
Thanks to [qlaffont](https://github.com/qlaffont/fortnite-api) for doing this API.

## Example

You can found SwaggerUI here https://skynewz-api-fortnite.herokuapp.com/api-docs

## INIT

To setup this module, you need to have an account on Epic Games. After that you need to get 2 dedicated headers from Fortnite.

How to get these headers ?
- Install & Open [Fiddler 4](https://www.telerik.com/download/fiddler)
- In Tools -> Options -> HTTPS, Select Capture HTTPS Connects
- After that start your epic games launcher.
- You will see a request with */account/api/oauth/token*. Click on it and click after that on Inspectors get the header (Authorization header content and remove basic) => **This header is your Client Launcher Token**
- Launch Fortnite
- You will see again a request with */account/api/oauth/token*. Click on it and click after that on Inspectors get the header (Authorization header content and remove basic) => **This header is your Fortnite Client Token**

--------
* Install & Open [Fiddler 4](https://www.telerik.com/download/fiddler)
* In Tools -> Options -> HTTPS, Select Capture HTTPS Connects
* After that start your epic games launcher.
* You will see a request with _/account/api/oauth/token_. Click on it and click after that on Inspectors get the header (Authorization header content and remove basic) => **This header is your Client Launcher Token**
* Launch Fortnite
* You will see again a request with _/account/api/oauth/token_. Click on it and click after that on Inspectors get the header (Authorization header content and remove basic) => **This header is your Fortnite Client Token**

---

## Start as docker container

### With REDIS
If you want to use a [Redis](https://hub.docker.com/_/redis/), use this [docker-compose.yml for example](https://github.com/SkYNewZ/rest-fornite-api/blob/master/docker-compose.yml) **replacing environements variables values by yours**.

If you want to use a [Redis](https://hub.docker.com/_/redis/), use this [docker-compose.yml for example](https://github.com/SkYNewZ/rest-fornite-api/blob/master/docker-compose.yml) **replacing environements variables values by yours**.

### Without REDIS

```bash
$ docker run -d --restart=always \
$ docker run -d --restart=always \
-e LOGIN_EMAIL=EMAIL ACCOUNT \
-e LOGIN_PASSWORD=PASSWORD \
-e OAUTH_EPIC_LAUNCHER=CLIENT LAUNCHER TOKEN \
-e OAUTH_FORTNITE=FORTNITE CLIENT TOKEN \
-p 3000:3000
skynewz/fortnite-api
```

This will listening on port 3000. You can check at http://localhost:3000/check

> **Note:**
> You can can the option -e PORT=1234 in order to use a custom port
## Start with nodejs

### Requirements

* Nodejs >= 8.9
> **Note:**
> You can can the option environements variable PORT=1234 in order to use a custom port
> **Note:**
> You can can the option environements variable PORT=1234 in order to use a custom port
### Start in developement mode

```bash
$ git clone https://github.com/SkYNewZ/rest-fornite-api
$ cd rest-fornite-api
Expand All @@ -64,6 +73,7 @@ $ npm run start-dev
```

### Start in production mode

```bash
$ git clone https://github.com/SkYNewZ/rest-fornite-api
$ cd rest-fornite-api
Expand All @@ -76,15 +86,10 @@ $ npm start
```

## Endpoint

Supported plateform : `pc`, `ps4`, `xb1`.
You can view endpoints at https://skynewz-api-fortnite.herokuapp.com/api-docs/

## Contributors

Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
## Just for fun

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
| [<img src="https://avatars3.githubusercontent.com/u/26750012?v=4" width="100px;"/><br /><sub><b>Quentin LEMAIRE</b></sub>](https://www.lemairepro.fr/)<br />[💻](https://github.com/SkYNewZ/rest-fornite-api/commits?author=SkYNewZ "Code") [📖](https://github.com/SkYNewZ/rest-fornite-api/commits?author=SkYNewZ "Documentation") [💡](#example-SkYNewZ "Examples") [🤔](#ideas-SkYNewZ "Ideas, Planning, & Feedback") [📦](#platform-SkYNewZ "Packaging/porting to new platform") [⚠️](https://github.com/SkYNewZ/rest-fornite-api/commits?author=SkYNewZ "Tests") | [<img src="https://avatars1.githubusercontent.com/u/24639184?v=4" width="100px;"/><br /><sub><b>Xewtwo</b></sub>](https://github.com/Xewtwo)<br />[🐛](https://github.com/SkYNewZ/rest-fornite-api/issues?q=author%3AXewtwo "Bug reports") [🤔](#ideas-Xewtwo "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/10044790?v=4" width="100px;"/><br /><sub><b>Quentin</b></sub>](http://qlaffont.com)<br />[💻](https://github.com/SkYNewZ/rest-fornite-api/commits?author=qlaffont "Code") [🤔](#ideas-qlaffont "Ideas, Planning, & Feedback") [⚠️](https://github.com/SkYNewZ/rest-fornite-api/commits?author=qlaffont "Tests") |
| :---: | :---: | :---: |
<!-- ALL-CONTRIBUTORS-LIST:END -->
[![Skynewz Stats](https://signature.stats-fortnite.com/pc/skynewz/signature.png)](https://stats-fortnite.com/battleroyale/profil/skynewz/pc)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0
3.0.2
41 changes: 28 additions & 13 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,64 @@
# Fortnite-API on NodeJs Server

[![Build Status](https://travis-ci.org/SkYNewZ/rest-fornite-api.svg?branch=master)](https://travis-ci.org/SkYNewZ/rest-fornite-api)
[![codecov](https://codecov.io/gh/SkYNewZ/rest-fornite-api/branch/master/graph/badge.svg)](https://codecov.io/gh/SkYNewZ/rest-fornite-api)
[![Docker Pulls](https://img.shields.io/docker/pulls/skynewz/fortnite-api.svg)](https://hub.docker.com/r/skynewz/fortnite-api/)
[![](https://images.microbadger.com/badges/version/skynewz/fortnite-api.svg)](https://microbadger.com/images/skynewz/fortnite-api "Get your own version badge on microbadger.com")
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors)
![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/QLemaire/2)

## Example

You can found SwaggerUI here https://skynewz-api-fortnite.herokuapp.com/api-docs

## INIT

To setup this module, you need to have an account on Epic Games. After that you need to get 2 dedicated headers from Fortnite.

How to get these headers ?
- Install & Open [Fiddler 4](https://www.telerik.com/download/fiddler)
- In Tools -> Options -> HTTPS, Select Capture HTTPS Connects
- After that start your epic games launcher.
- You will see a request with */account/api/oauth/token*. Click on it and click after that on Inspectors get the header (Authorization header content and remove basic) => **This header is your Client Launcher Token**
- Launch Fortnite
- You will see again a request with */account/api/oauth/token*. Click on it and click after that on Inspectors get the header (Authorization header content and remove basic) => **This header is your Fortnite Client Token**

--------
* Install & Open [Fiddler 4](https://www.telerik.com/download/fiddler)
* In Tools -> Options -> HTTPS, Select Capture HTTPS Connects
* After that start your epic games launcher.
* You will see a request with _/account/api/oauth/token_. Click on it and click after that on Inspectors get the header (Authorization header content and remove basic) => **This header is your Client Launcher Token**
* Launch Fortnite
* You will see again a request with _/account/api/oauth/token_. Click on it and click after that on Inspectors get the header (Authorization header content and remove basic) => **This header is your Fortnite Client Token**

---

## Start as docker container

### With REDIS
If you want to use a [Redis](https://hub.docker.com/_/redis/), use this [docker-compose.yml for example](https://github.com/SkYNewZ/rest-fornite-api/blob/master/docker-compose.yml) **replacing environements variables values by yours**.

If you want to use a [Redis](https://hub.docker.com/_/redis/), use this [docker-compose.yml for example](https://github.com/SkYNewZ/rest-fornite-api/blob/master/docker-compose.yml) **replacing environements variables values by yours**.

### Without REDIS

```bash
$ docker run -d --restart=always \
$ docker run -d --restart=always \
-e LOGIN_EMAIL=EMAIL ACCOUNT \
-e LOGIN_PASSWORD=PASSWORD \
-e OAUTH_EPIC_LAUNCHER=CLIENT LAUNCHER TOKEN \
-e OAUTH_FORTNITE=FORTNITE CLIENT TOKEN \
-p 3000:3000
skynewz/fortnite-api
```

This will listening on port 3000. You can check at http://localhost:3000/check

> **Note:**
> You can can the option -e PORT=1234 in order to use a custom port
## Start with nodejs

### Requirements

* Nodejs >= 8.9
> **Note:**
> You can can the option environements variable PORT=1234 in order to use a custom port
> **Note:**
> You can can the option environements variable PORT=1234 in order to use a custom port
### Start in developement mode

```bash
$ git clone https://github.com/SkYNewZ/rest-fornite-api
$ cd rest-fornite-api
Expand All @@ -60,6 +69,7 @@ $ npm run start-dev
```

### Start in production mode

```bash
$ git clone https://github.com/SkYNewZ/rest-fornite-api
$ cd rest-fornite-api
Expand All @@ -72,5 +82,10 @@ $ npm start
```

## Endpoint

Supported plateform : `pc`, `ps4`, `xb1`.
You can view endpoints at https://skynewz-api-fortnite.herokuapp.com/api-docs/
You can view endpoints at https://skynewz-api-fortnite.herokuapp.com/api-docs/

## Just for fun

[![Skynewz Stats](https://signature.stats-fortnite.com/pc/skynewz/signature.png)](https://stats-fortnite.com/battleroyale/profil/skynewz/pc)
Loading

0 comments on commit 54c87d8

Please sign in to comment.