Questions tagged [locomotivejs]

Locomotive is a web framework for Node.js. Instilled with familiar MVC patterns and a conventional file layout.

Locomotive is a web framework for Node.js. Instilled with familiar MVC patterns and a conventional file layout.

See http://locomotivejs.org/

Features

  • MVC architecture
  • Convention over configuration
  • Expressive routing
  • Routing helpers
  • Connects to any database
  • Renders with any template engine
  • Adheres to REST principles
  • Built on Express

Community

65 questions
11
votes
1 answer

NodeJs and Ejs Pass Arrays to page

I am trying to pass an array to an .ejs page, however when I try use var test ="<%= data %>"; console.log(test); I get the output [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object…
h00j
  • 308
  • 1
  • 7
  • 18
5
votes
1 answer

Catch "Failed to look up view" error and serve 404

I am currently routing every page to my pagesController that cannot be found in previous routes by including this line in routes.js: this.match('/:page', { controller: 'pages', action: 'show' }); I had the idea to let my PagesController handle…
Spork
  • 1,631
  • 1
  • 21
  • 37
4
votes
1 answer

model validation on server side in locomotivejs

I want to know if there is a function to check if my model is valid on server side ,I am using locomotivejs on express. here is my model schema var BillSchema = new Schema({ BrandId:Schema.Types.ObjectId, ModelNo:{ type: String, required:…
C M
  • 684
  • 9
  • 22
3
votes
1 answer

NodeJS Can't Access Variable Inside Callback

I believe this is a problem with it being async, but I do not know the solution. PagesController.buy = function() { var table=""; Selling.find({}, function(err, res) { for (var i in res) { console.log(res[i].addr); table =…
h00j
  • 308
  • 1
  • 7
  • 18
2
votes
1 answer

Why does the scroll only take up half the width of the item? Locomotive scroll

Why do the elements only scroll halfway through and then freeze? In the locomotive scrolling demonstration itself, these elements don't stop, but scroll further. I need the exact same thing. What needs to be set or changed for this? demo
2
votes
1 answer

LocomotiveJS - How to access another controller's method

I'm using locomotivejs to build an api and I wanted to know if there was a way to access a controller method from within another controller?
clueless
  • 839
  • 1
  • 10
  • 24
2
votes
1 answer

AngularJS - How to get serverside and clientside routing to work together

Im working on porting a project over to an angular based SPA. Its currently a more "traditional" node/locomotivejs app that serves up templates from the server side (never known the proper term for this). The projects too large to to migrate all…
Zak Kus
  • 1,503
  • 3
  • 15
  • 28
2
votes
1 answer

Start locomotive.js 0.4.x for functional testing

The way to start locomotive.js 0.3.x no longer works in 0.4.x, as the signature of app.boot is different. I have: before(function(done) { var self = this; var lcm = new locomotive.Locomotive(); lcm.boot('test', function() { self.app =…
Zebra Propulsion Lab
  • 1,736
  • 1
  • 17
  • 28
2
votes
1 answer

Store sessions in mongodb with connect-mongo and mongoose

I am getting errors left and right while I try to configure the express.js session storage with mongodb. I am using locomotive for my framework and have configured mongoose. In my initializers directory for 02_mongoose.js I have…
lumberjacked
  • 966
  • 1
  • 21
  • 35
2
votes
1 answer

Add api token in middleware using express.js and locomotive.js

I'm building a rest api server that I will use with an angularjs frontend. I am trying to implement some middleware that runs on every request. For every request I want to check for an api token if present continuing checking if valid, if not…
lumberjacked
  • 966
  • 1
  • 21
  • 35
2
votes
1 answer

Node.js custom render building

I'm building an API in node.js with express, and I would like to extend the basic res.send from ANY of the external route files before a response is sent, as to pre-format the response and append in additional data. How is this possible? Thanks in…
willium
  • 2,048
  • 5
  • 25
  • 34
2
votes
1 answer

How do I set coffescript in Locomotivejs?

What should I do to set coffeescript in Locomotivejs. It seems very easy, but I couldn't figure that out. I set options in "all.js", without luck. I think I'm almost there or very far to get it right. :( this.set("options",{coffee:true}); Any help…
mrocha
  • 90
  • 5
2
votes
2 answers

403 / Forbidden on favicon with NodeJS / Express

I'm currently testing LocomotiveJS and have a very simple "hello world" app up I thought I'd set up the connect favicon middleware, but when I visit any route ('/' for example) I get the following in the console: 127.0.0.1 - - [Tue, 17 Jul 2012…
Alex
  • 37,502
  • 51
  • 204
  • 332
1
vote
1 answer

Locomotive Scroll: Is it possible to use querySelector with an URL and an anchor tag?

The links in my navigation use URLs with an anchor-tag (f.e. mysite.com/about#cv). The reason being that i want to jump/scroll to a specific section even if i am not on the f.e. about-page. Normally this works fine. But i am using the locomotive…
amnds
  • 21
  • 2
1
vote
0 answers

Is it possible to have locomotive.js infinite loop when scrolling down?

I'm wondering if it's possible to make locomotive.js infinite loop to the start of the content when you reach the bottom?
monsaic123
  • 241
  • 2
  • 11
1
2 3 4 5