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
1
vote
1 answer

Locomotive Scroll function trigger

Can someone tell me how to trigger a function when the element is in view in locomotive scroll, I am kind of noob, please explain in detail, Thanks in advance const counterFunc = () => { counters.forEach((counter) => { const updateCount = () =>…
1
vote
2 answers

Can't scroll down using Barba.js and Locomotive scroll

I'm using barba.js and locomotive scroll together, I have overlay transition which work when I click the menu link (page2) to go to another page, but once that is down I cant scroll down when, I added the below code barba.hooks.beforeLeave((data) =>…
dotun seyi
  • 43
  • 1
  • 10
1
vote
1 answer

How can I set a base template in Locomotive.js?

I don't want to set my assets (CSS/JS, menu, etc) on each view from my project. Is there any way to set a base template and then call views just to fill its body? Example:
Claudio Holanda
  • 2,455
  • 4
  • 21
  • 25
1
vote
1 answer

Locomotive.js throws error upon calling "locomotive.boot"

I'm trying to write tests on my locomotive.js application, literally copy/pasting code from some examples on the internet. Even so, whenever I run my tests, I get an error saying TypeError: string is not a function When I check the number of…
pandringa
  • 358
  • 1
  • 3
  • 9
1
vote
1 answer

Rest API with LocomotiveJs using CORS. Works on local machine but not on Amazon or Heroku

Rest API with LocomotiveJs using CORS. Works on local machine but not on Amazon or Heroku I did a REST api using LocomotiveJs and now I'm trying to enable CORS on it. I added the following code to my "all" environment…
Rodrigo Reis
  • 1,891
  • 1
  • 11
  • 12
1
vote
1 answer

locomotivejs and mongoose: passing promise variables to a controller

preamble: I'm not sure if this is the best way to ask this question as I'm fairly sure it's more general than I'm making it and there's probably a global pattern that address my concern. For the moment here's the question in the context of the…
Crispen Smith
  • 513
  • 4
  • 20
1
vote
2 answers

LocomotiveJS Server Port Change

I am using locomotivejs for my node project. When I fire the lcm server command locomotive listen to port 3000 as default. I tried to change it but nothig worked. I thin I am missing something. From where should I change the listened port for lcm…
SamSamet
  • 395
  • 1
  • 5
  • 20
1
vote
1 answer

NodeJS Ejs Variable Render HTML

You can output variables using ejs like so PagesController.test = function() { this.title = 'test' this.render(); } <%= title %> However I tried including html in the variable and it just displays it as text. Is it possible to…
h00j
  • 308
  • 1
  • 7
  • 18
1
vote
2 answers

locomotive.js listen to http and https

i have a locomotive.js MVC project , and its listening on http. i want to listen on https , and redirect all http to https. i cant find the createServer of node.js, the only code i find is: under…
IdanHen
  • 266
  • 3
  • 11
1
vote
1 answer

Best way to setup locomotivejs with passport-twitter?

I'm trying to configure passport-twitter in my locomotive project. The problem is that nothing happens after hitting the /auth/twitter url. Edit: I hit the controller but twitter seems to not be invoked. What I did was set a match to /auth/twitter…
ffhenkes
  • 13
  • 7
1
vote
1 answer

Testing locomotive.js with Mocha

I am building an app with locomotive.js, and I am looking to build my test suite using the Mocha test framework. I am also new to TDD/BDD in general, so please take that into consideration. I am curious if anyone can point me in a good direction to…
Adam Duro
  • 882
  • 1
  • 9
  • 21
1
vote
2 answers

setting response headers with expressjs behind nginx

We have an web application build using node js (express js), which is behind nginx. For a particular API, we want to have the content-type response header as "text/plain". For this following code is there in controller. res.setHeader('Content-Type',…
C M
  • 684
  • 9
  • 22
1
vote
1 answer

How to use sessions in Locomotive.js

I am giving a look at the node.js web framework Locomotive. Since it is built on top of Express, I suppose Connect middleware should be easily accessible, but I can't find out how. I added 2 lines to…
lortabac
  • 589
  • 4
  • 16
0
votes
0 answers

locomotive JS trigger a script after inizialization

I need to trigger a script after locomotive has been initialize but I can't find a list of event that locomotive it is listening at scroll.on('init', (args) => { console.log('init'); }); but it doesn't seem to work
al404IT
  • 1,380
  • 3
  • 21
  • 54
0
votes
0 answers

Locomotive JS, does not load the final part of the site

I made a theme for Wordpress, using Swup and Locomotive js. When I see the theme page, it is half loaded. It doesn't scroll to the footer. If I refresh the page then I see it perfectly. I'll give you the code Thank you all jQuery(function($)…
realCode
  • 43
  • 1
  • 1
  • 4