by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Mark HM
@markhm
Thanks @svenvarkel. This might indeed explain my problem -> https://stackoverflow.com/a/60774741.
Sven Varkel
@svenvarkel
no worries
I've wrestled with it in AWS a few years ago. It was exactly the problem there. I had to reconfigure load balancer :)
Mark HM
@markhm
I am trying to undertstand my best options for deploying atm, so this is helpful input. 👍🏻
Sven Varkel
@svenvarkel
I'm myself wrestling with broken skipper-gridfs library. it just stopped working and doesn't upload anything to mongodb gridfs :)
Mark HM
@markhm
I have no experience with uploading files to sails, unfortunately.
Have you perhaps ever seen an example of a https://bootstrap-vue.org/ frontend on Sails…? I am trying to find an example that uses a modern approach with action2s. I need some help understanding how to set it up.
Sven Varkel
@svenvarkel
I'm using SvelteJS frontend. SailsJS only for the REST API
I've been using action2 for several years now, it's really straightforward
however, I don't use view's or templates or anything. SailsJS is pure API and a separate web app is the client :)
Mark HM
@markhm
Yes, in general it works quite well for me too. But I don’t understand how to add bootstrap-vue to the frontend. I started using Sails thinking that would bring me all I needed, not realising that this also meant having to learn Vue, Bootstrap and some other things. :)
I had never heard of SvelteJS. Will take a look.
Sven Varkel
@svenvarkel
Svelte is a bit different. It's a compiler. It pre-compiles your app so it's much smaller and works much faster in the browser
Mark HM
@markhm
For which kind of apps would you recommend it…?
NeoNexus DeMortis
@neonexus
@markhm While it is using React, and not Vue, I would imagine you should get a couple good ideas from sails-react-bootstrap-webpack
Sven Varkel
@svenvarkel
huh, dunno actually. I guess it depends on a lot of things like business requirements but also developer skills and availability
3 replies
Mark HM
@markhm
Thanks @neonexus. I had already taken a brief look, but was unable to quickly start your example, since it uses mysql by default. I need to spend some more time to get it up and running.
NeoNexus DeMortis
@neonexus
Oh, just remove / change the datastore back to sails-disk
Then comment out / remove the contents from bootstrap.js
Mark HM
@markhm
Yes, will give it another try tomorrow and will let you know. Thanks again for mentioning it.
NeoNexus DeMortis
@neonexus
@markhm I'm glad I brought it up; gives me inspiration to make the bootstrap.js schema validation configurable...
Shashan Sooriyahetti
@OnbitShashan

hey anyone here knows why is this keep happening,

message=Unexpected error from database adapter: connection 5 to xxx.xx.xx.xx:27017 timed out, stack=AdapterError: Unexpected error from database adapter: connection 5 to xxx.xx.xx.xx:27017 timed out

at /home/projects/ideadroid/Appmaker-Backend/node_modules/parley/lib/private/Deferred.js:303:7
at /home/projects/ideadroid/Appmaker-Backend/node_modules/sails-mongo/node_modules/machine/lib/private/help-build-machine.js:954:24
at Function.handlerCbs.success (/home/projects/ideadroid/Appmaker-Backend/node_modules/sails-mongo/node_modules/machine/lib/private/help-build-machine.js:814:26)
at Object.fn (/home/projects/ideadroid/Appmaker-Backend/node_modules/sails-mongo/lib/private/machines/release-connection.js:77:18)
at wrapper (/home/projects/ideadroid/Appmaker-Backend/node_modules/@sailshq/lodash/lib/index.js:3282:19)
at Deferred.parley.retry [as _handleExec] (/home/projects/ideadroid/Appmaker-Backend/node_modules/sails-mongo/node_modules/machine/lib/private/help-build-machine.js:1076:19)
at Deferred.exec (/home/projects/ideadroid/Appmaker-Backend/node_modules/parley/lib/private/Deferred.js:286:10)
at Deferred.switch (/home/projects/ideadroid/Appmaker-Backend/node_modules/sails-mongo/node_modules/machine/lib/private/help-build-machine.js:1469:16)
at /home/projects/ideadroid/Appmaker-Backend/node_modules/sails-mongo/lib/private/do-with-connection.js:242:92
at /home/projects/ideadroid/Appmaker-Backend/node_modules/sails-mongo/lib/private/do-with-connection.js:123:18
at Object.success (/home/projects/ideadroid/Appmaker-Backend/node_modules/sails-mongo/lib/private/build-std-adapter-method.js:61:47), name=AdapterError, adapterMethodName=find, modelIdentity=article, name=MongoError, _originalStack=MongoError: connection 5 to xxx.xx.xx.xx:27017 timed out

--

Mark HM
@markhm
I have a parasails/Vue component with props that update automatically ( {{hour}}, {{minute}} ) when they are changed from outside of this component. That works fine. Question is now: how can trigger I re-initialization of the component on a change? These props define which part of the data needs to be processed (which is done in the initialization method), so when they change, initialization needs to happen again. 🙏🏻
Noitidart
@Noitidart
has anyone done an endpoint to create and export an excel file? just curiours about your experience, any recommendations you had. i was going to be doing this soon
RSA
@aflatoon2874
@Noitidart - There is a npm package named xlsx. You can explore it for your use case. It is good
Noitidart
@Noitidart
Thanks @aflatoon2874 i used it, it works great!
Noitidart
@Noitidart

has anyone used mailgun and ever got this:

4.7.0 [TSS04] Messages from IP_HERE temporarily deferred due to user complaints - 4.16.55.1; see https://help.yahoo.com/kb/postmaster/SLN3434.html

I don't know how to resolve this and customers complaining they arent getting qr code
Jarrod
@nahanil
Mailgun uses shared IP addresses & someone else is probably sending out spam. There's some blacklist checks online if you know the originating IP - complaining to mailgun generally gets you switched to a different outbound IP
@noitidart
Noitidart
@Noitidart
oooo thank you so much @nahanil i will escalate that!
Mark Brown
@markwbrown
I'm getting an error on sails lift : 'Error defining hook: config is a reserved property and cannot be used as a custom hook method.');
9 replies
Mark Brown
@markwbrown
anybody know where this is coming from?
Mark HM
@markhm
Hi. I've just patched a third-party component that my application uses (it is defined in my application's package.json and installed in node_modules).
I would like to understand my options to ensure my application uses the patched component when it is deployed from GitHub.
  • Can I somehow deliver my application with the patched component, rather than the one original one...?
  • Can I release the patched version to npm myself and refer to the increased version number...?
Jarrod
@nahanil
@markhm You can specify a git repo as a dependency in your package.json or publish a fork as say @markhm/fancymodule
1 reply
Yemi Ilupeju
@festburn

good morning all. just following along with a tutorial from 3 years ago.

any idea why using this in my view doesn't work:

<a href="/articles/edit/<%= article.id %>" class="btn btn-primary">Edit</a>

to go here in my controller js named ArticlesController:

edit:function(req, res){
console.log(req.params.id);
Articles.findOne({id: req.params.id}).exec(function(err, article){
if(err){
res.send(500, {error: 'Database Error'});
}
res.view('pages/edit', {article: article});
});
}

it says the page does not exist. the article id is generated correctly in the URL of the 404 page and i have actions: true in my blueprints.js file

thank you in advance

mohammad reza esmailzadeh
@smr8012101067_gitlab
hi
error: Could not load Sails app.
error:
error: Tips:
error: • First, take a look at the error message above.
error: • Make sure you've installed dependencies with npm install.
error: • Check that this app was built for a compatible version of Sails.
error: • Have a question or need help? (http://sailsjs.com/support)
i have this error , pleas help me?
!!!!
NeoNexus DeMortis
@neonexus
@smr8012101067_gitlab Did you actually read the error? Did you npm install like it says?
Yemi Ilupeju
@festburn

good morning all. just following along with a tutorial from 3 years ago.

any idea why using this in my view doesn't work:

<a href="/articles/edit/<%= article.id %>" class="btn btn-primary">Edit</a>

to go here in my controller js named ArticlesController:

edit:function(req, res){
console.log(req.params.id);
Articles.findOne({id: req.params.id}).exec(function(err, article){
if(err){
res.send(500, {error: 'Database Error'});
}
res.view('pages/edit', {article: article});
});
}

it says the page does not exist. the article id is generated correctly in the URL of the 404 page and i have actions: true in my blueprints.js file

thank you in advance

figured out my issue. Thanks for the lovely documentation, Sails!

To Edit my model item, this is sufficient in my view

<a href="/articles/<%= article.id %>" class="btn btn-primary">Edit</a>

Then my controller now contains a blueprint action called findOne, https://sailsjs.com/documentation/reference/blueprint-api/find-one

Using findOne as the function in my ArticlesController, takes over the action i need to happen when i "get" the model item by id.

erfan
@erfanwakka
Hi guys I have problem using beforeCreate it does not work and call !
here is my code:
module.exports = {
schema: {
loginCredentials: {
type: {
username: {
type: String,
required: true,
unique: true
},
password: {
type: String,
required: true
}
}
},
personalInformation: {
type: {
firstName: {
type: String,
required: true
},
lastName: {
type: String,
required: true
},
email: {
type: String,
required: true
},
phone: {
type: Number,
required: true
},
address: {
type: String
},
company: {
type: String,
default: "Sarveen"
},
url: {
type: String,
default: 'http://sarveentech.ir/'
}
}
},
},
beforeCreate: function (user, proceed) {
bcrypt.genSalt(10, function(err, salt){
bcrypt.hash(user.loginCredentials.password, salt, null, function(err, hash){
if(err) return proceed(err);
user.loginCredentials.password = hash;
return proceed();
});
});
},
customToJSON: function() {
return _.omit(this, ['loginCredentials.password'])
},
};
Asaf Cohen
@asafco4
Hi all, can I use bootstrap or webflow as my frontend to my sails app?
Need help to build the front-end
1 reply
mylesnotario
@mylesnotario
hi, I'm just learning how to use sails. And I wonder how we'll still be able to display dynamic values in views without using exposeLocalsToBrowser()? And I noticed that when viewing the page source, user info are being displayed in there. thanks!
Mauricio
@marcovecchiom

hi, i trying to connect to postgres datastore.

My config:
default: {
adapter: 'sails-postgresql',
ssl: true,
port: 5432,
host: 'localhost',
user: 'postgres',
database: 'database',
schema: true
}

My Model:
module.exports = {
tableName: 'table',
attributes: {
name: {
type:'string'
}
}

My Action:
var record = await MyModel.findOne({
id:1
});

I cant get any response from record. What i'm doing wrong? Thx!

5 replies
Noitidart
@Noitidart
why does sails store the ip in user.tosAcceptedByIp? is this a standard thing? does it conflict with gdpr?
5 replies
RSA
@aflatoon2874
@marcovecchiom - It seems you are using Node v14. The sails-postgresql adapter is broken on Node v14. The maintainers know of this issue for over a month now. Switch to node v12