Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 11 17:47
    sailsbot commented #7246
  • Aug 11 17:47
    DominusKelvin opened #7246
  • Aug 11 09:05
    ViKingQ starred balderdashy/sails
  • Aug 11 07:16
    AlexShemelin starred balderdashy/sails
  • Aug 11 06:22
    snowdream1985 starred balderdashy/sails
  • Aug 11 00:31

    eashaw on master

    0.9.2 (compare)

  • Aug 11 00:31

    eashaw on v0.9.2

    0.9.2 (compare)

  • Aug 11 00:30

    eashaw on master

    Update package.json Merge pull request #198 from sa… (compare)

  • Aug 11 00:30
    eashaw closed #198
  • Aug 11 00:23

    eashaw on master

    1.5.3 (compare)

  • Aug 11 00:23

    eashaw on v1.5.3

    1.5.3 (compare)

  • Aug 10 21:15
    eashaw opened #198
  • Aug 10 21:14

    eashaw on update-async

    Update package.json (compare)

  • Aug 10 21:12

    eashaw on master

    upgrade ejs to 3.1.7 (#7243) (compare)

  • Aug 10 21:12
    eashaw closed #7243
  • Aug 10 21:08

    eashaw on master

    Add heading about the __Host- p… (compare)

  • Aug 10 21:08
    eashaw closed #7245
  • Aug 10 21:08
    sailsbot commented #7245
  • Aug 10 21:07
    eashaw opened #7245
  • Aug 10 21:06

    eashaw on docs-add-note-about-cookies

    Add heading about the __Host- p… (compare)

John Wolfe
@wolfejw86
I found the solution to my answer
if anyone else runs into this issue
this page in the docs says you need the /add/ as part of the url
looking closer at the add to reference doc page, https://sailsjs.com/documentation/reference/blueprint-api/add-to
you do not need the add word
so for me, PUT /:modelIdentity/:id/:association/:fk works beautifully
John Wolfe
@wolfejw86
does anyone know of a situation with sails 1.0 where you should use the add word? i am using it in a many to many scenario in mongo, perhaps there's a time when you need it?
Ayan Banerjee
@ayanb1991
I am using Sails@0.12.3 and want to serve my uploaded assets/files from a specified directory. But can not set static middleware.
Most of the solutions from stackoverflow implements a express middleware in config/http.js but in my case it's not working.
Mike McNeil
@mikermcneil
@wolfejw86 I've never worked on an app with versioned models
@KSDaemon redeploying the site now, cleared things up https://trello.com/c/TW3VEMJk
@KSDaemon thanks again for bringing it to my attention
Mike McNeil
@mikermcneil
https://sailsjs.com/documentation/reference/request-req/req-accepted-languages now redirects to https://sailsjs.com/documentation/reference/request-req/req-accepts-languages (and so on). Added note to upgrading guide. I think we're good here, but if anyone runs into any other related stuff from the that we missed from the Express 4 upgrade, please holler at me asap (twitter pm if necessary)! I want to get anything like that taken care of as early in the 1.0 release cycle as possible so we don't get forced to go 2.0 earlier than we'd like
maczor
@maczor
@ayanb1991 I usually do it using grunt symlink to create as many as I need in public path
Ayan Banerjee
@ayanb1991
@maczor I want to use express like virtual routes for my case. Like this app.use('/original/images', express.static(path.join(__dirname, 'uploads/image')));
Sails is forcing me to keep static file inside assets directory.
Actually I want to store my uploaded files to a directory named 'uploads' and want to serve those files as static assets in a virtual route as I said earlier.
Marco Romano
@marcorom88_twitter
hi all
How can view error messages on form login and sign up on form on modal?
brookesb91
@brookesb91
@marcorom88_twitter You’re asking a very broad question. What have you got implemented already?
Konstantin Burkalev
@KSDaemon
@mikermcneil I’m glad that i can help a little :)
Hamza
@hamzaOp
@marcorom88_twitter in your endpoints, you need to respond with well formed error objects and then let the frontend outputs the result , but it's really a broad question, can you give more clarifications ?
Marco Romano
@marcorom88_twitter
I have a homepage that have a map, on this homepage have a navbar with some links, included login and signup. When I click on login or signup open a modal, and not a view on a new page, but on a modal dialog. On this dialog I have a form. I create action on controller for signup and login and works. Only managed errors and response json for app android, but I want use this error on form modal dialog. For example, If I do not enter username I want a error on dialog, if I write password wrong I want an error on modal dialog, etc etc
brookesb91
@brookesb91
@marcorom88_twitter Understood. I’m going to guess that you’re using EJS pages to serve views?
You’re looking to keep the model above the view and login without navigating away. I get that. What you could do is have a model that is triggered by a url param mysite.com/home#login - In your controller you can redirect to this view with a list of errors you want outputting.
Pavel Shabardin
@bigbn
Hello everyone, can Model.getDatastore().sendNativeQuery be combined with Model.stream() api?
Something like this
await Order.getDatastore().sendNativeQuery('SELECT * FROM "orders"').stream().eachBatch(async (batch, next) => {
is it possible?
brookesb91
@brookesb91
@bigbn Have you tried testing it?
Pavel Shabardin
@bigbn
yes, there is no such methods
brookesb91
@brookesb91
Why not just use native stream?
Pavel Shabardin
@bigbn
because sails already have nice stream abstraction for find() maybe there is a same for sendNativeQuery exist?
Marco Romano
@marcorom88_twitter
npm ERR! Linux 4.4.0-77-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "bcrypt" "--save"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! bcrypt@1.0.3 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 7
npm ERR! 
npm ERR! Failed at the bcrypt@1.0.3 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/smash_node/npm-debug.log
Hi, try install bcrypt on my machine linux and I have this error. On my pc works, but on server no...
I have node 4.x, and on my pc 9.x. It is possible that the problem it is?
Dean Hantzis
@professor-rage

couple interesting things I've noticed with Sails 1.0 today:

  1. model attribute unique:true does not work with mongodb v3.2. It creates an index, but does not set it as unique
module.exports = {
  migrate: 'alter',
  attributes: {
    eventId: {
      type: 'number',
      unique: true
    },
...

My current solution is to ensureIndex in bootstrap.js and remove attribute unique:true on model attr

  await Event.native(function(err, collection) {
    collection.ensureIndex({eventId: 1}, {unique: true});
  });
  1. sails run [scriptName] does not execute bootstrap.js (intended functionality?)

  2. createEach() .tolerate('E_UNIQUE') (sails-mongo, mongodb v3.2) will stop creating the following records once tolerate unique is triggered. So if 10 records to createEach, and E_UNIQUE triggers at idx 5, idx > 5 will be skipped due to db server error. My attempt to brute force createEach without checking for uniqueness in DB is for a high performance ETL process. I know this is hack-ish, but I don't believe there is support for something like MYSQL's multi-row REPLACE INTO or MONGO find/upsert. I should probably go native for this...

My guess is that only #1 is a bug and #2/#3 are expected behavior. @mikermcneil @particlebanana I can file a bug for #1 if you'd like. Let me know what you think of #2 and #3 if you have a min. THX

Ayan Banerjee
@ayanb1991
@maczor I want to use express like virtual routes for my case. Like this app.use('/original/images', express.static(path.join(__dirname, 'uploads/image')));
Any solution for it???
Marco Romano
@marcorom88_twitter
Hi, I write also on nodejs gitter, but I write also here, and I hope that someone can help me
I have a problem very big with node js
I have a server on https that started with nodejs 4.2.6 with pm2 and all works. Now i can start another project on another path on same port always on https, but use bcrypt and with nodejs 4.x doesn't works, and old project started with pm with version 8.x doesn't work. This project it is on sails js. The goal is migrate all api express on sails, but initially I want both server on execution and migration by step. Can I resolve this problem? Start 2 server on same port but different path, and problem with version of nodejs
Thomas Lepérou
@tleperou
@marcorom88_twitter uhm. You cannot serve twice on the same port. This is a system/network constraint
For bcrypt, be sure to compile with the version of nodeJs you're trying to work with.
now, if you want to keep the same https://URL:port and route requests either to ex-express or new Sails, you should set up a proxy like Nginx
iamlennym
@iamlennym
@zimudec Did you manage to find a simple example of an implementation of a Vue router with parasails?
bramu
@bramu_twitter
Hello need help
I am new to Sails and trying the find method from console and getting this error
sails> const object = Category.find({id: 1})
undefined
sails> object
[Deferred]
how to see the object contents
can someone help me with this?
even in controller when I try to access model I am getting the syntax error const category = await Category.find({id: 1});