- /project-root
- /config
- /src
- /services
- /authentication
- /items
- /users
- index.js
- index.js
- /services
- package.json
🤙
- GitHub Staff
- alexisabril.com
- @alexisabril
- in/alexis-abril
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am alexisabril on github. | |
* I am alexisabril (https://keybase.io/alexisabril) on keybase. | |
* I have a public key ASATOxoB1AhmacsFFixNievsoEsDZniIQhVFi2qcDXG0dwo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const heroprotocol = require('heroprotocol'); | |
heroprotocol.gameevents('path/to/replay.StormReplay').then(output => { | |
//output is a JSON object! | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { authenticate } = require('@feathersjs/authentication').hooks; | |
/* | |
By placing the `authenticate` hook in `before.all`, any request received by this application | |
must first pass through this hook. The `authenticate` hook accepts an array of named strategies. | |
This application is built on the premise that a valid JWT will be created after successful OAuth | |
verification. As a result, the JWT strategy is the only required input. | |
*/ | |
module.exports = { | |
before: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"dependencies": { | |
"@feathersjs/authentication": "^2.1.5", | |
"@feathersjs/authentication-jwt": "^2.0.0", | |
"@feathersjs/authentication-oauth2": "^1.0.3", | |
"@feathersjs/configuration": "^1.0.2", | |
"@feathersjs/express": "^1.2.2", | |
"@feathersjs/feathers": "^3.1.4", | |
"body-parser": "^1.18.2", | |
"feathers-memory": "^2.1.1", | |
"passport-google-oauth2": "^0.1.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The authentication module sets up the `/authentication` endpoint, while the JWT module handles | |
the creation and verification of JWTs. The OAuth2 and Passport modules handle where OAuth requests | |
should be sent and how they are received. Passport handles the OAuth flow and upon completion invokes | |
the respective Feathers service call(s). | |
*/ | |
const authentication = require('@feathersjs/authentication'); | |
const jwt = require('@feathersjs/authentication-jwt'); | |
const oauth2 = require('@feathersjs/authentication-oauth2'); | |
const { Strategy } = require('passport-google-oauth2'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"port": 9001, | |
"authentication": { | |
"secret": "...", | |
"google": { | |
"clientID": "...apps.googleusercontent.com", | |
"clientSecret": "..." | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"port": 9001, | |
"authentication": { | |
"google": { | |
"clientID": "...apps.googleusercontent.com", | |
"clientSecret": "..." | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const feathers = require('@feathersjs/feathers'); | |
const memory = require('feathers-memory'); | |
const hooks = require('feathers-hooks-common'); | |
const app = feathers(); | |
app.use('/items', memory()); | |
app.service('items').hooks({ |