Recipe
- Install NVM
- Install IO.js
- Install global Node.js utility modules (gulp, jspm, yo)
- Install RethinkDB
- Install Koa.js
- Install Aurelia generator
- Create Aurelia app via generator
let testCall = async () => { | |
return await _.callApi(route + '/rate', 'POST', requests.rate); | |
} | |
test('route: components') | |
.that('POST component rating') | |
.will('add a rating to the component', async () => { | |
check.ratingAdded(testCall()); | |
}) | |
.will('NOT add a second rating to the component for the same user', async () => { |
require('babel-core/register'); | |
require('babel-polyfill'); | |
const chai = require('chai'); | |
chai.should(); | |
class Tester { | |
constructor(parent, text, opts) { | |
this.parent = parent; | |
this.text = text; |
/* ======================================================================== | |
* Ratchet: push.js v2.0.2 | |
* http://goratchet.com/components#push | |
* ======================================================================== | |
* inspired by @defunkt's jquery.pjax.js | |
* Copyright 2014 Connor Sears | |
* Licensed under MIT (https://github.com/twbs/ratchet/blob/master/LICENSE) | |
* ======================================================================== */ | |
/* |
// alternative way | |
ChildRouteLocator.prototype.convertInstructionToConfigurationUrl = (instruction) => { | |
}; |
Folder structure of app | |
app | |
models | |
decorators | |
- typically used to decorate a model with client side functionality | |
validators | |
- for validate middleware, one per model | |
routes |
export default Styles {
constructor(props, state) {
this.props = props;
this.state = state;
this.createGeneric()
}
generic() {
return [];
models/loader.ls
loads all files under models dir into app.Models namespace
models/validators/loader.ls
loads all files under validators dir into app.Model.Validator namespace
routes/validators/loader.ls
# namespaces.js | |
# Contains top level app namespaces | |
exports.do = | |
Models: {} | |
Controllers: {} | |
new-ns: (ns) -> | |
# split on "." and add recursively to self | |
var nsParts = namespace.split("."), |