sails.js

Sails.js - Is there intended support for a “one-way-many” association

邮差的信 提交于 2019-12-20 03:19:12
问题 I'm interested in a one-way-many association. To explain: // Dog.js module.exports = { attributes: { name: { type: 'string' }, favorateFoods: { collection: 'food', dominant: true } } }; and // Food.js module.exports = { attributes: { name: { type: 'string' }, cost: { type: 'integer' } } }; In other words, I want a Dog to be associated w/ many Food entries, but as for Food , I don't care which Dog is associated. If I actually implement the above, believe it or not it works. However, the table

Manually include assets in SailsJS 0.9.7

流过昼夜 提交于 2019-12-20 02:27:11
问题 I'm trying to manually include some assets in SailsJS, however I can't get them to work. They keep 404'ing. The config/routes.js comments tell me that and image in assets/images/1.png would be accessible via href="images/1.png" . The same thing doesn't seem to apply for stylesheets as <link rel="stylesheet" href="/styles/style.css"> results in a 404 not found. I saw that Sails uses a very extensive Gruntfile as of lately, but I wanted a bit more control so I ditched it. I know that breaks the

Conditional publish events

假如想象 提交于 2019-12-20 02:13:58
问题 Introduction I'm building a private messaging system using sails, but this question can apply to pretty much anything. I'll be using the messaging system as an example to make the question more clear. As a bit of background info, I'm working with the latest sails 0.10 RC. The problem Sails allows you to use redis for sessions and pubsub, which allows you to scale over multiple servers. This is all very neat and works brilliantly, but it leaves me with the question of how to publish events to

Conditional publish events

喜你入骨 提交于 2019-12-20 02:13:36
问题 Introduction I'm building a private messaging system using sails, but this question can apply to pretty much anything. I'll be using the messaging system as an example to make the question more clear. As a bit of background info, I'm working with the latest sails 0.10 RC. The problem Sails allows you to use redis for sessions and pubsub, which allows you to scale over multiple servers. This is all very neat and works brilliantly, but it leaves me with the question of how to publish events to

Sails.js bodyParser - request entity too large on version 0.10.5

血红的双手。 提交于 2019-12-19 09:23:09
问题 I am trying to post a lot of data to my sails API and I get this 413 error: Unable to parse HTTP body- error occurred - Error: request entity too large I have tried a lot of solutions suggested in differents discussions but it never works and seems to be for previous sails version. (it’s always about changing the bodyParser options) Does anybody know the correct syntax for sails 0.10.5? Thanks a lot! 回答1: Does anybody know the correct syntax for sails 0.10.5? Thanks a lot! Take a look at this

Simple page app routes to same view or controller SailsJS

微笑、不失礼 提交于 2019-12-19 07:51:14
问题 How can I route multiple urls to the same controller or view to work with angular single page app?! I can do this but i think is ugly.. '/': { view: 'homepage' }, '/login': { view: 'homepage' }, '/register': { view: 'homepage' }, '/troller': { view: 'homepage' }, ............ I want somethink like ['/','/login','/register','/troller'] -> view: 'homepage' And other question, Can I use regular expressions for routing? Thx!! and sorry for my english. 回答1: You can't currently use real regular

Sails.js get many to many association count

南笙酒味 提交于 2019-12-19 06:37:10
问题 I have a model (user) that has an association with another model (phone). This association is many to many. The following call is built in to Sails and allows me to get all the phone records for a particular user: GET - /user/:userId/phones I would like to be able to implement pagination on that call but cannot figure out how to get the total number of results. I've tried overwriting the blueprints find.js and/or findOne.js in order to return the count but the call above doesn't seem to run

Deploy Sails.js on Openshift … app restarting over and over [duplicate]

孤人 提交于 2019-12-19 05:54:28
问题 This question already has an answer here : Deploying Sails.js On Openshift (1 answer) Closed 4 years ago . I want to deploy sails.js (version 0.9.7) app to Openshift but after git push I get this log: debug: Lowering sails... DEBUG: Starting child process with 'node app.js' . . . info: Server lifted in `/var/lib/openshift/525ccaba5973caa65100002b/app-root/runtime/repo` info: To see your app, visit http://127.7.215.1:8080 info: To shut down Sails, press <CTRL> + C at any time. . . debug: -----

Anyway to set proxy setting in passportjs?

百般思念 提交于 2019-12-19 05:45:07
问题 Currently, I am using sails framework which is based on expressjs and using passportjs(http://passportjs.org/) to do yammer authentication. I have problem when deploying my node app on server which is behind the company proxy. It cannot connect to yammer for OAuth2 authentication. The error is as follow: error: failed to obtain access token (Error: connect ETIMEDOUT) at /root/rlps/node_modules/passport-yammer/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth2.js:125:38 at /root

Sending Socket request from Client (iOS & Android) to Sails.js Server

守給你的承諾、 提交于 2019-12-19 04:56:47
问题 I'm trying to use socket.io with iOS and Android App, but there is some problem here. I'm asking if there is anyone who actually has solutions. How can I send socket.io request from client (iOS, Android), I think there is socket.io libraries for iOS and Android and iOS lib has sendEvent/Message/JSON methods. However, I couldn't find a way to get the events at the sails. https://github.com/pkyeck/socket.IO-objc https://github.com/koush/AndroidAsync So is there any way that I can send socket.io