- Feathers
- feathers-mongoose
- only used for the model validation
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
/* global window, document, choo, yo, extend */ | |
// const extend = require('xtend'); | |
var html = yo; | |
const app = choo(); | |
const store = { | |
getAll: (storeName, cb) => { | |
try { | |
cb(JSON.parse(window.localStorage[storeName])); | |
} catch (e) { |
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 cmd = require('child_process').execSync; | |
var yarnInstalled; | |
try { | |
cmd('yarn bin').toString(); | |
yarnInstalled = true; | |
} catch (err) { | |
yarnInstalled = false; | |
} |
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 app = {}; | |
class Channel { | |
constructor () { | |
this.connections = []; | |
} | |
add (connection) { | |
this.connections.push(connection); | |
} |
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
<script src="../node_modules/steal/steal.js"> | |
window.rerun = true; | |
function rerunIfSuccessful() { | |
var result = document.getElementById('qunit-testresult'); | |
var failed = result.getElementsByClassName('failed'); | |
if (!failed.length) { | |
setTimeout(rerunIfSuccessful, 4000); | |
} else if (failed[0].innerHTML === "0" && window.rerun) { |
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
// src/app.js | |
/** | |
* There's not much to do here. Just remove or comment out | |
* the lines that use feathers.static (the public/ directory) | |
*/ | |
app.use('/', feathers.static(app.get('public'))); // Find and remove this line |
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
{ | |
"host": "localhost", | |
"port": 3030, | |
"public": "../public/", | |
"paginate": { | |
"default": 10, | |
"max": 50 | |
}, | |
"authentication": { | |
"secret": "jcOPTCaY9ikyp5emSA4ChcF3Q3Pytwmadr6G954JDO8XURb5LW1btEOZ2CVgeCOe", |
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
'use strict'; | |
const authentication = require('feathers-authentication'); | |
const jwt = require('feathers-authentication-jwt'); | |
const local = require('feathers-authentication-local'); | |
module.exports = function() { | |
const app = this; | |
const config = app.get('authentication'); |
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
'use strict'; | |
const { authenticate } = require('feathers-authentication').hooks; | |
const { hashPassword } = require('feathers-authentication-local').hooks; | |
// Bring in the `iff` hook. | |
const { iff } = require('feathers-hooks-common'); | |
module.exports = { | |
before: { | |
find: [ |
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
{ | |
"accept": "application/json, text/javascript, */*; q=0.01", | |
"accept-encoding": "gzip, deflate, br", | |
"accept-language": "en-US,en;q=0.8,cy;q=0.6", | |
"authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6ImFjY2VzcyJ9.eyJ1c2VySWQiOiI0akZ4SEtQWXRpcnVwMkROIiwiaWF0IjoxNDkxNTM3ODExLCJleHAiOjE0OTE2MjQyMTEsImF1ZCI6Imh0dHBzOi8veW91cmRvbWFpbi5jb20iLCJpc3MiOiJmZWF0aGVycyIsInN1YiI6ImFub255bW91cyJ9.zOqO6bUgQrsMy7JIea6eoDCrMUqnIj2qKE8CPFOvhsQ", | |
"cache-control": "no-cache", | |
"connection": "keep-alive", | |
"content-length": "31", | |
"content-type": "application/json", | |
"host": "localhost:3030", |