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
start: "node app" | |
test: "gulp test" | |
docker: | |
build: "docker-compose build" | |
run: "docker-compose up" | |
docs: | |
clean: "rimraf _book" | |
prepare: "gitbook install" | |
build: | |
- "zx docs:prepare" |
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
var registerPlugin = require('register-plugin'); | |
var domify = require('domify') | |
function helloWorld(app, options, next) { | |
app.sayIt = function() { | |
document.body.appendChild(domify('Hello world!')); | |
}; | |
next(); | |
} |
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'; | |
var magicHook = require('magic-hook'); | |
function Logger() { | |
magicHook(this, ['log']); | |
} | |
Logger.prototype.log = function(msg) { | |
console.log(msg); |
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
[].filter || (Array.prototype.filter = // Use the native array filter method, if available. | |
function(a, //a function to test each value of the array against. Truthy values will be put into the new array and falsy values will be excluded from the new array | |
b, // placeholder | |
c, // placeholder | |
d, // placeholder | |
e // placeholder | |
) { | |
c = this; // cache the array | |
d = []; // array to hold the new values which match the expression | |
for (e in c) // for each value in the array, |
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
./node_modules/.bin/actionhero generateInitializer —name=knex |
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
‘pg_config’ is not recognized as an internal or external command, | |
operable program or batch file. | |
gyp: Call to ‘pg_config —includedir’ returned exit status 1. while trying to load binding.gyp |
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
gyp ERR! stack Error: Python executable “python” is v3.4.1, which is not supported by gyp. |
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
$ npm install [email protected] --save | |
# Then add one of the following (adding a --save) flag: | |
$ npm install mysql | |
$ npm install mariasql | |
$ npm install pg | |
$ npm install sqlite3 |
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
configData.mySql = { | |
database: 'actionHero', | |
username: 'root', | |
password: 'root', | |
host: '127.0.0.1', | |
port: 3306, | |
} |
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
var knex = require('knex'); | |
exports.knex = function (api, next) { | |
api.knex = knex(api.configData.mySql); | |
next(); | |
} |