Questions tagged [sails.js]

Sails.js is a web framework that makes it easy to build custom, enterprise-grade Node.js apps. It is designed to resemble the MVC architecture from frameworks like Ruby on Rails, but with support for the more modern, data-oriented style of web app development.

Sails.js is a web framework that makes it easy to build custom, enterprise-grade Node.js apps. It is designed to resemble the MVC architecture from frameworks like Ruby on Rails, but with support for the more modern, data-oriented style of web app development.

It uses Express for features like HTTP requests handling and websockets. Its intuitive websockets wrapper makes it especially good for building realtime features like chat.

Website | Getting Started | Documentation | App Anatomy | Submit Issue

6583 questions
110
votes
5 answers

Node.js Web Application examples/tutorials

So I finished watching Douglas Crockford's excellent series on Javascript, and in the final episode (so far), loopage he lays out why Node.js is a near perfect solution for server side code. He talks about keeping state, not in the database, but…
Kris Erickson
  • 33,454
  • 26
  • 120
  • 175
107
votes
8 answers

Auto reloading a Sails.js app on code changes?

Currently is seems that for any code change in a sails.js app you have to manually stop the sails server and run sails lift again before you can see the changes. I was wondering if there is any way when running in development mode to automatically…
subblue
  • 1,406
  • 2
  • 12
  • 12
91
votes
17 answers

NPM "ENOENT: no such file or directory error" when installing Sails.js dependencies with Node 8.9.4 LTS

I recently upgraded my computer and with it, to the latest LTS version of Node and NPM: Node.js 8.9.4 NPM 5.6.0 I have a Sails.js 0.12.14 application for which I'm trying to install NPM dependencies with npm install but when I do that, I get the…
JackH
  • 4,613
  • 4
  • 36
  • 61
86
votes
5 answers

How do I convert an image to a base64-encoded data URL in sails.js or generally in the servers side JavaScript?

I am making a small app in sails.js and I need to store images in database. For that, I need to convert an image to a base64-encoded data URL so that I can save it as a string in my sails models. However, I don't know how to convert it in this form.…
Mahammad Adil Azeem
  • 9,112
  • 13
  • 57
  • 84
86
votes
8 answers

How to create global variables accessible in all views using Express / Node.JS?

Ok, so I have built a blog using Jekyll and you can define variables in a file _config.yml which are accessible in all of the templates/layouts. I am currently using Node.JS / Express with EJS templates and ejs-locals (for partials/layouts. I am…
Cory Gross
  • 36,833
  • 17
  • 68
  • 80
81
votes
4 answers

Sails.js vs Meteor - What are the advantages of both?

I've been reading a lot on Nodejs and its frameworks and recently finished my first full javascript frontend (using Angularjs). I've decided that my next pet project will be a Nodejs adventure using one of these two frameworks: Sails.js…
pedropeixoto
  • 1,633
  • 2
  • 27
  • 52
54
votes
2 answers

SELECT and UPDATE multiple records in oriento / orientjs and transaction in waterline

How can I select or update multiple records in oriento? Like in waterline we can offersModel.update({id:items_ids,status:INACTIVE},{status:ACTIVE}) But in waterline transaction is not available. So I want to use : var db =…
9me
  • 1,078
  • 10
  • 36
51
votes
9 answers

Sails.js populate nested associations

I've got myself a question regarding associations in Sails.js version 0.10-rc5. I've been building an app in which multiple models are associated to one another, and I've arrived at a point where I need to get to nest associations somehow. There's…
Lars Dol
  • 765
  • 1
  • 6
  • 14
50
votes
5 answers

AngularJS + sails.js

I am developing an app that can utilize sails.js for back-end and AngularJS for Front-end. I thought that I'll create an Angular App using Yeoman-angular generator https://github.com/yeoman/generator-angular, and once I am done with the front-end…
rishy
  • 1,559
  • 3
  • 14
  • 17
43
votes
2 answers

npm install not installing latest version on GitHub

I have a module called 'sails-mongo' and I want to update it to the newest version using the following command: npm update sails-mongo --save I also tried uninstall then install again. I tried sails-mongo@latest and sails-mongo@beta. Problem: The…
user2867106
  • 1,139
  • 1
  • 13
  • 31
43
votes
2 answers

Create config variables in sails.js?

I'm converting an app of mine from Express to sails.js - is there a way I can do something like this in Sails? From my app.js file in Express: var globals = { name: 'projectName', author: 'authorName' }; app.get('/', function (req, res) { …
user2688473
  • 633
  • 1
  • 6
  • 8
42
votes
1 answer

What services would one add to the api/services folder in sails.js

I have a question consisting of two parts: What are the types of services one would add to the api/services folder in a sails.js app. How would one 'wire' those services to the rest of the application. Thanks, TM
tmueller
  • 512
  • 1
  • 5
  • 8
42
votes
5 answers

How do I connect bower components with sails.js?

I'd like to be able to install Javascript dependencies through bower and use them in a sails.js app, but I can't figure out a way to do this with out just copying an pasting files from the bower_components folder to the Sails assets folder. Ideally…
Cole Reed
  • 1,036
  • 1
  • 10
  • 12
36
votes
4 answers

Redis - How to expire key daily

I know that EXPIREAT in Redis is used to specify when a key will expire. My problem though is that it takes an absolute UNIX timestamp. I'm finding a hard time thinking about what I should set as an argument if I want the key to expire at the end of…
bless1204
  • 643
  • 1
  • 8
  • 17
34
votes
10 answers

Can't get POST body from request using Express.js

I'm working on an API with NodeJS and Express (and more stuff like mongo, sockets, etc) but i'm stuck on a very simple step I believe. I'm just trying to get the information from the POST req object, but I get an error when trying to access req.body…
kevinblanco
  • 779
  • 2
  • 7
  • 13
1
2 3
99 100