How to use React.js to render server-side template on Sails.js?
I am trying to build an isomorphing app with Sails.js and React. Client-side part is easy. But I run into problems with server-side rendering.
I am trying to build an isomorphing app with Sails.js and React. Client-side part is easy. But I run into problems with server-side rendering.
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.
According to this closed issue in sails:
https://github.com/balderdashy/sails/issues/835
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 looking to do something similar to the global variables like site.title
that are found in _config.yml
if anyone is familiar with Jekyll. I have variables like the site’s title, (rather than page title), author/company name, which stay the same on all of my pages.
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.
There is a way in socket.io to create a timeout in the disconnected event, then check if the user has been reconnected ?
How come in sails you cannot access other controller methods from within another one?
I’m still having difficulty understanding how to add middleware to sails.js. I’ve heard use policies.js, create custom policies, add to local.js, etc. So could someone please show me how exactly I would add the jquery-file-upload-middleware to a sails app. Thanks in advance
This is an extension of this question.
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. All the older questions asked about converting an image to base64-encoded data URLs, and they answer this about doing it on the client side. However, I want to do it on the server side while I will be getting the image through a post request. How can I achieve this?