Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
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});
const category = await Category.find({id: 1});
showing me this error
    const category = await Category.find({id: 1})
                           ^^^^^^^^
SyntaxError: Unexpected identifier
iamlennym
@iamlennym
Can anyone point me to a simple example of using the Vue router with parasailsjs? I could not find a lot of documentation on this.
Hamza
@hamzaOp
@bramu_twitter did you put the async keyword before the function ? async function(..) { ..... }
Thomas Lepérou
@tleperou
@iamlennym do you mean like this one? https://github.com/ndabAP/vue-sails-example
Marco Romano
@marcorom88_twitter
@tleperou with apache is possible if here on path different... I want start 2 server on https with same port for mantain same endpoint for continue working on app. Exist an alternative?
If app call domain.com/user and now with new server call domain.com:81/user, on app will not works
I found some about nginx, I try this solution
bramu
@bramu_twitter
@hamzaOp I have added that but still error seems coming
Hamza
@hamzaOp
@bramu_twitter same error ? can you give a snippet of the code ?
bramu
@bramu_twitter
all: async function(req, res) {
const category = await Category.find({id: 1});
return res.view('categories/all', {name: category.name});
}
this is all I am doing but when I try from console also its throwing the error
martskins
@martskins
@bramu_twitter what version of node are you running?
bramu
@bramu_twitter
8.6.0
node -v
v8.6.0
is it issue with node version
martskins
@martskins
no, it shouldn't be
it could be if you were using node < 6, but 8 should be ok
I can't say if console should work with async/await, but your controller definitely should
brookesb91
@brookesb91
@bramu_twitter I’ve had a similar issue - I had an issue with node running an older version
bramu
@bramu_twitter
oh
any work around can suggest I am unable to start the first, any sample project from where I can check the code?
brookesb91
@brookesb91
try nvm ls
paste what is output
if it’s not using the version you need .. use nvm use x.x
It’s odd - always runs that version in vs code but a separate terminal runs everything fine - it’s not a huge issue
you can nvm default x.x.x
sorry… nvm alias default x.x.x
This isn’t an issue with your code, it is mot likely your running node version.
bramu
@bramu_twitter
I am not using any nvm
nvm ls
-bash: nvm: command not found
Is there any way to generate model attributes data based on existing database table in MySQL?
brookesb91
@brookesb91
@bramu_twitter How does your Cateogry model look?
and are you able to show your whole controlelr code?
Controller*