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.
6,577
questions
0
votes
0
answers
12
views
Socket.io server side implementation in Sails JS
I'm currently working on socket.io server-side implementation. And I'm using Sails JS as server-side framework. And I found socket io implementation on nodeJS express server on Socket.io documentation....
0
votes
0
answers
15
views
How to search elements of string array within a column of a table in sails js
I have a string array. I want to find if there is any match to those strings within a column using sails js query language. In the documents, it says we can use the contains modifier; but it needs to ...
0
votes
0
answers
11
views
Sails.js api request not posting to database
I'm creating a RESTApi using sails.js, for some reason GET calls work correctly, but POST returns an empty array. Here is my sails code:
const crypto = require('crypto')
module.exports = {
...
1
vote
0
answers
13
views
I can't create a file download controller
When I try to use the .pipe() function in my controller I get an error and I don't know why. Attached my code below, thank you very much for the help in advance
const fs =require('fs');
module....
1
vote
1
answer
15
views
SailsJS - Waterline - Many to Many Database Table
I've joined an existing project where we use SailsJS and Waterline for our ORM.
I've noticed the following database table : category_items__item_categories but I don't see any model for it.
Here's the ...
0
votes
1
answer
28
views
SailsJS - Waterline - add column to many to many relationship
I'm trying to create a many to many realtionship between the following object and I'd like to include an "is_active" boolean column on the relationship.
here are the objects:
Item.JS
module....
0
votes
1
answer
28
views
How to get array response in horizontal way of 3 array javascript
I have 3 different arrays in JavaScript, they have always the same length or may be not and I need to change response of this array in JSON format
I am getting this below response right now.:-
"...
0
votes
1
answer
18
views
Cannot add the 15th collection to Sails Mongo
I am getting a failure whenever I try to add my 15th collection.
errorType': 'Error', 'errorMessage': 'Callback was already called.', 'trace': ['Error: Callback was already called.', '
at eval (...
0
votes
0
answers
13
views
Get migrations to run on Waterlinejs standalone
Node version: (18.0.0)
DB adapter & version (sails-postgresql@4.0.0):
I kindly require assistance to get migrations to run on waterline standalone version 0.15.0
My config is as follows:
module....
0
votes
0
answers
9
views
How Do I Force SSL On My Sails js App Running On Heroku?
I am trying to force my website to use SSL hosted on Heroku no matter what. I have a custom domain on Google Domains, I'm paying for the hobby dyno which comes with encryption provided by Heroku, and ...
0
votes
0
answers
27
views
Tool for moving API code from monolith to micro-service
We are currently in the process of moving code from our monoliths to different micro-services. There are 2 monoliths one using express, the other using sails on top of nodejs. I have already moved a ...
0
votes
0
answers
10
views
Sails 1.x: Is there a way to get criteria in beforeUpdate life-cycle hook?
I am debugging an issue that requires me to compare old and new data for against an id in the database. However, I am not able to get the old data in the beforeUpdate hook. I have looked over the ...
0
votes
1
answer
25
views
Specify length and scale parameters of decimal (numeric) data type in waterline orm (sails js)
How to specify decimal(length, scale) as a columnType in waterline orm for a currency column? I could find this question has been already asked. But the answer is not relevant to the question.
This is ...
0
votes
0
answers
20
views
Find method in sailsjs breaks when where parameter has “in” as value
I have a find method where I need to filter data which has a value of “in” in it.
For example: Something.find( {type: inputs.type, countryCode: inputs.countryCode} ) throws an error when inputs....
0
votes
0
answers
21
views
How can i get data from a sails.js DB server to an android app?
i have an android app and a server with sails.js. In this server i have a model. I'd like to know how can i get the data in this model from my android app?
I should also filter this data before ...
0
votes
1
answer
23
views
SailsJS populate with select records
OperationalError [UsageError]: Invalid populate(s).
Details:
Could not populate parentId. This is a singular ("model") association, which means it never refers to more than one associated ...
0
votes
0
answers
14
views
Storage link not loading image sails and get 404 error
I've an app made with Sails.js and tested, and worked fine before, but now if someone load a new image, the app throw an 404 with that file. The olders one are working very well in this point, but the ...
1
vote
0
answers
70
views
Running Sail for the first time on a new Laravel project, fails with exit code: 127
I'm trying to run sail up for the first time, on a virtual machine (Ubuntu).
Here's what I think might be connected to the issue I'm having:
8.11.0
fable@KOMPUTER:~/*****$ sudo ./vendor/bin/sail up
[...
0
votes
0
answers
20
views
TypeError: Cannot read property 'toJSON' of undefined sails js
i am trying to authenticate using passport jwt i have create a services folder inside it a file called CipherService.js with the following content
const bcrypt = require('bcrypt-nodejs');
const jwt = ...
0
votes
1
answer
138
views
sequelize.transaction is not a function
I run 'npm install sequelize sqlite3' and 'yarn add sequelize sqlite3', my backend and front is running, but when i call my function this return an error "sequelize.transaction is not a function&...
0
votes
1
answer
16
views
BelongsTo in Sails.js
Hello, I need your help please with 2 questions.
I have 2 Models
One to Many
(One) Customer{ id, names, dni} -> Invoice {id, date, ....customer_id} (Many)
1. How can I get this?
I need to consume ...
0
votes
0
answers
21
views
How to customize default find, findOne, create and update actions in SailsJS?
I'm using SailJS to build a REST API.
I've a lot of nested models, such as:
A building has many Floors, which have many Apartments, which have an Owner.
The Sails populate implementation doesn't work ...
0
votes
1
answer
48
views
NPM_ERROR_WHEN_IN _SAILS
node:internal/process/promises:279 triggerUncaughtException(err, true /* fromPromise */);
0
votes
0
answers
17
views
Is there any way to throttle api hits globally using sails.js
The scenario is where an API is calling to a backend service. I need to apply throttling in such a way that not more than 15 requests hits the backend service within say 1 minute.
Currently my backend ...
0
votes
0
answers
21
views
Add Vue.js, jQuery and Lodash to and empty app in Sails.js?
I'm new in Sails.js, I'created a new app in Sails with sails new app and the option 2. empty but I want to keep all the utilities inserted when I use the 1. WebApp option. What happens is the 1. ...
0
votes
1
answer
26
views
Failed to lift app: Error: Sails is taking too long to load
Sails has a default timeout by default when starting the app. How to remove this or maybe how to extend the timeout?
0
votes
0
answers
9
views
function(err,user) , in that case why user gives Undefined..........user:Undefined
here i have a function of create. that could be created a model .
but in that case req.allParams() have collect all data but in callback function there is user have return Undefined why??
create:...
1
vote
0
answers
98
views
504 error on nodejs sails API server randomly across all endpoints
we have sails js as an API server and intermittently we are facing 504 upstream timed out the issue, the call was going till Nginx from there its throwing upstream timeout, there is no log coming on ...
0
votes
0
answers
9
views
Error: Unknown adapter "sails-db2" for connection
After upgrade node version to 14, sails-db2 throws the following error, but its working fine with node 8.06, please suggest any solution.
enter image description here
0
votes
0
answers
31
views
TypeError: orm.onInitialized is not a function
I am trying to upgrade my node version 8 to 14, in version 8, its working fine, but when I switch it to node 14+, waterline for db2 is not working its showing following error.
TypeError: orm....
0
votes
0
answers
50
views
Why a new sequence is generated in PostgreSQL Database when the table is altered?
I have a project deployed in google cloud and using a Postgres database. The backend was written in Sails js. My question is when I altered a table (added a new column to the video table), USER table ...
0
votes
1
answer
20
views
Sails Js blueprint update without primary key
In sails Blueprint API, update action is defined as PATCH /:model/:id. Here 'id' is the primary key of the model. But I need to find a record not from the 'id' but from another column value and update ...
0
votes
1
answer
624
views
Sails.js: Jest spyOn results in TypeError: Cannot assign to read only property
I'm trying to mock the implementation of a function call using Jest's spyOn:
await sails.helpers.models.test.randomFn.with({ ... });
const randomFnSpy = jest.spyOn(sails.helpers.models.test.randomFn, ...
0
votes
1
answer
66
views
Listening to sails socket in react
I'm trying to listen to changes from Sails socket in the front-end using react.
Server listen to changes in a MongoDB Collection and blasts the changes:
// Setting up connection to MongoDB
const ...
0
votes
0
answers
34
views
Failed to lift app: Error: Encountered error attempting to instantiate a session store using the installed version of `connect-mongo`
Trying to run my app through a localhost server but a few days ago this error message showed up out of nowhere. I'm using Sails.js with version ^1.3.2 for connect-mongo along with version ^1.2.0 for ...
0
votes
1
answer
50
views
How to remove the url param after it was completed
I am trying to remove the url param after function was completed, so it won't break the uix.
Here how it looks if param is not removed
http://localhost:1337/check?domain=fb.com&success=task&...
0
votes
0
answers
119
views
Code shows TypeError: Cannot read property 'response' of undefined
Api To verify session and fetch user details.
module.exports = {
friendlyName: 'Verify',
description: 'Verify customer.',
inputs: {
},
exits: {
success: {
responseType: "success"
},
failure: ...
0
votes
0
answers
8
views
SailsJS: automatic asset linking modifies source files
When running (i.e. "lifting") a SailsJS application it injects HTML link and script tags into the files stored in views/ folder, which is comfortable when adding or renaming assets.
It also ...
0
votes
1
answer
30
views
Getting message exist in console while UID is not in database
I am trying to check if the UID exists in db. If it exist I want it not to write a data else write a data.
But for some reason I am getting exist when there is no such UID.
async function engagements(...
0
votes
0
answers
15
views
Sails Js - API returning status code 200 with status CLOSED
I am developing the APIs using sails.js, I encountered one problem today while checking the API logs, some of the APIs (GET, POST, PUT, DELETE) are returning the status code 200 with status CLOSED ...
0
votes
0
answers
30
views
NPM modules with Sails.js, and more specifically: using Dropzone.js with Sails.js
I've been using Sails.js for a year or so off and on, but when it comes to adding an NPM module I'm a bit confused. Specifically, I'm trying to use Dropzone with Sails for multi-file uploading and am ...
0
votes
0
answers
21
views
Sails Uncaught SyntaxError bootstrap-5
I have this problem when i make sales lift in my project -> this is what I get from the console of browser :
Uncaught SyntaxError: import declarations may only appear at top level of a module ...
0
votes
0
answers
61
views
Cannot use dot notation in a constraint target without enabling experimental support for "deep targets" SAILSJS
I got this issue during query using sails.js
code: 'E_INVALID_CRITERIA',
details: 'Could not use the provided `where` clause. Could not filter by `book.bookId`: Cannot use dot notation in a constraint ...
0
votes
0
answers
39
views
error: A hook (`userconfig`) failed to load and module export
info: Winston logger has been started on Ridepal
error: A hook (userconfig) failed to load!
error: Failed to lift app: Error: When using aggregate, modules must export dictionaries. But module (scala\...
0
votes
1
answer
43
views
sailsjs returns http code 426 when using a host name
While using SailsJS locally (using localhost everything works fine) but if I switch to a hostname (127.0.0.1 defined in the hosts file). I get http code 426.
Here is the error that I get:
Http 426
Not ...
1
vote
0
answers
11
views
In Sails Node JS app, I am trying to access a session variable in ejs layout but can't view it
This is my code
In controller:
if (foundUser.length) {
req.session.authenticated = true;
req.session.userId = foundUser.id; // returned from a database
res....
0
votes
0
answers
41
views
Sails nested array association of Models
A Mongodb collection (say 'Competency') whose structure is as follows:
{
"staff_id": "CEB",
"competency": [{
"workflow": "Workflow A",
...
0
votes
0
answers
28
views
Encountered an error when attempting to require('sails);
i am having a terrible day figuring out this error. Below is Dockerfile and docker-compose. I addded 'RUN npm -g install sails', error persist Encounter an error when attempting to require('sails') ...
0
votes
0
answers
65
views
How can I use express-rate-limit in sailsJS?
I want to use a express-rate-limit middleware in sailsJS framework for preventing brute force attacks/ adding attempts for logging in. The documentation shows the implementation for basic nodejs but ...
1
vote
0
answers
166
views
Similar framework to API Platform on NodeJS?
I'm using API Platform with Symfony and i would like to start using NodeJS instead to have to code only on javascript.
I'm unable to find a project that does what API Platform does.
1 - Automatic REST ...