codeship-tutorials / codefish-node Goto Github PK
View Code? Open in Web Editor NEWA simple node.js app used in Codeship screencasts.
A simple node.js app used in Codeship screencasts.
Hey there, so I have been struggling to find a node template that works right off the bat with codeship. This one did the trick. But since the app.js is wrapped in a var app = function () {
trying to add within routes using var routes = require('./routes/routes');
and then app.use('/routes', routes);
does not work when in the routes.js file I try to use var router = express.Router();
and:
router.get('/', function(req, res, next) {
res.render('index', { title: "Codefish", header: "I've entered the Codeship!", paragraph: "I just deployed my Node.js app with Codeship" });
});
Similarly if I try to refactor the app.js and remove the var app = function () {
and inject into it the app.listen(...
from start.js and alter the package.json to "main": "app.js"
, that works locally, but when I run it through to codeship > heroku, node does not automatically load and so nothing gets served... Any idea why this might be the case? Would you have a refactored version that works with routes etc...? Thank you.
The 2 specs provided don't function properly, if you run jasmine-node with the
"--captureExceptions" flag you will see:
..
Finished in 0.039 seconds
2 tests, 0 assertions, 0 failures, 0 skipped
TypeError: Object [ A ] has no method 'text'
at /Users/john/Projects/Javascript/Node/codefish-node/spec/frontpage_spec.js:15:65
at _fulfilled (/Users/john/Projects/Javascript/Node/codefish-node/node_modules/zombie/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/Users/john/Projects/Javascript/Node/codefish-node/node_modules/zombie/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/Users/john/Projects/Javascript/Node/codefish-node/node_modules/zombie/node_modules/q/q.js:759:13)
at /Users/john/Projects/Javascript/Node/codefish-node/node_modules/zombie/node_modules/q/q.js:573:44
at flush (/Users/john/Projects/Javascript/Node/codefish-node/node_modules/zombie/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.