Node.js

Node.js is a fast, lightweight platform (built on Chrome’s JavaScript runtime) used to quickly and easily create scalable network applications.

Node.js subscription active
You will receive email notifications for new publications on Node.js.
621 Results
  • Question

    How to run node.js server with Nginx

    Hi all, I'm trying to figure out how to get my Node server.js to run on my droplet with Let's Encrypt / nginx It was working by just ssh-ing into the droplet, cd into the project folder (cloned from Github repo) and r...
    Accepted Answer: Hmmm all that sounds like it should work... Just to be clear, this is what your nginx config should look like: ``` server { listen 80; servername mydomain.com www.mydomain.com; return 301 https...
    1 By keithj0nes Nginx DigitalOcean Node.js Ubuntu 16.04
  • Question

    How to use one droplet for frontend (nuxt) and backend (node app) on subdomains of the same domain.

    Hello I am new with Digital Ocean and want to know how to use different urls for different apps (please include nuxt.js). my backend will be an API that is why I need another domain. I know there is a feature on nuxt ...
    Accepted Answer: Hi there @23brewert, What I could suggest here is using Nginx as a reverse proxy so that you could proxy the traffic to your different apps based on your domain names. I could suggest starting with this article here o...
    1 By 23brewert API Node.js
  • Question

    How to use pm2 monitoring on node app in new DO Apps ?

    With the new Digital Ocean app launch system, I'm having a hard time figuring out how I can use pm2 monitor to effectively monitor the health, traffic and over all status on my API. My current setup is running it on a...
    Accepted Answer: Hi WeaponizedLogo, Make sure your start command uses pm2-runtime instead of pm2. Also, add your Environment Variables to the app component PM2PUBLICKEY and PM2SECRETKEY. Best, Moises
    1 By WeaponizedLego Node.js Deployment DigitalOcean Monitoring DigitalOcean App Platform
  • Question

    How do i make my discord bot run 24/7?

    When i close the terminal the bot closes how do i make it not close, So it can run all night all day.
    Accepted Answer: You need some node module that would allow to run it forever. I can recommend you two - pm2 or forever. I'm more on side of pm2 as it have better process management. Also there are tutorials on DO for setting it up. F...
    6 By SReach DigitalOcean Node.js
  • Question

    Access node based web server with public IP

    I have installed a node based lightweight web server https://www.npmjs.com/package/http-server in my droplet and trying to serve a directory with it. mkdir web cd web http-server This shows the output as - Startin...
    Accepted Answer: Hi @jaibatrik Can you check if your firewall is active? sudo ufw status And run this command to show listening services: sudo lsof -iTCP -sTCP:LISTEN -P
    1 By jaibatrik Node.js Ubuntu
  • Question

    Nginx gives 502 Bad Gateway when proxying to nodejs app running on different docker container

    I am using docker compose to create 2 containers one for application running on Nginx and another for backend application on Nodejs(running on another port 4000) with routes of patterns "/org-metadata/, /proxy-api/, /...
    Accepted Answer: Hello, I've tried testing your setup, what fixed the problem at my end was adjusting this part in the Nginx config: upstream backend { server 127.0.0.1:4000; } To: upstream backend { ser...
    2 By rgth Nginx Docker Node.js React
  • Question

    How to solve Nginx WebSocket secure (wss) “error 426 Upgrade Required”?

    Hello I tried to configure a Websocket proxy on my Nginx server, but unfortunately, I don't get it working. I have read various forms but cannot get out of it. I think it has something to do between the client connec...
    Accepted Answer: Hi @dedominique94, I believe you'll need to change your server block. Please change your location block to be the following ``` location / { proxypass http://websocket; proxyhttpversion 1...
    2 By dedominique94 Nginx Node.js
  • Question

    How to configure NGINX to avoid 502 Bad Gateway when communicates with a Docker container?

    Hi, my case is that after having set up a new Droplet with an Ubuntu 18.04 server and have followed the DO tutorials to: 1. Install Nginx 2. Secure Nginx with Let's Encrypt 3. Install Jenkins 4. Configure Jenkins with...
    Accepted Answer: OK just add an update that some days after my latest post, I realized that the main and only reason the server was going down was a lack of resources in the droplet. So I was using a droplet with 1GB of RAM, 25GB HD, ...
    3 By jlbb Nginx Docker Ubuntu 18.04 CI/CD Node.js
  • Question

    Can't reach my Node.js application

    Hello world! I've created a Ubuntu NodeJS 8.10.0 on 18.04 droplet. I've deployed a Node.js app, tested on my computer. I can reach my app from inside the Droplet. curl http://localhost:3000 I can't reach my app from ...
    Accepted Answer: Greetings! I would bet that your application is listening on 127.0.0.1, as opposed to the public interface. If you run netstat -tulpn you should see the applications listening, and it might look something like this: ...
    2 By juliojordan Node.js Ubuntu 18.04
  • Question

    Does a droplet’s ip ever change while in use?

    I would like to allow users to connect to Kubernetes droplets and stay connected over a droplet’s public ip.
    Accepted Answer: No, Actually Droplet IP never change itself. If you want to change and using load balancer you can reassign the public ip interfaces but that is again manual. If you are not using load balancer the public IP once assi...
    2 By 314brett Kubernetes IPv6 Node.js
  • Question

    Docker container share volume is not working

    Hi Guys, I would like to share a volume,my Apache load balance is doing redirect to specific container. I have cache on my code, we can't go with cluster or pm2 module. ``` echo "Create N/W" docker network create --su...
    Accepted Answer: Hi there @kalapanabudhe, I believe that when you do --volumes-from it needs to be followed only by the name of the container that you want to use the volumes from. Have you tried chaning the following: --volumes-from...
    1 By kalapanabudhe Angular Docker Apache Node.js
  • Question

    Run Node server on DigitalOcean and run client on Zeit/Vercel

    My intention is to run my server on a DigitalOcean droplet using a subdomain, server.mywebsite.com. But I still want to run my client on Vercel (previously known as Zeit) at mywebsite.com. So: frontend -> mywebsite.co...
    Accepted Answer: Solved. There were two things I need to fix: 1. Vercel Settings I was adding server.mywebsite.com to the A record in Vercel instead of just the subdomain portion server. Their UI did not make it clear that I was accid...
    1 By jpangelle Node.js
  • Question

    Securing Dockerized MERN app via HTTPS?

    I am building a MERN stack application in docker containers, deployed with docker-compose, as a personal project, which i will deploy. i am curious how i go about securing this. i know that i need to setup https betw...
    Accepted Answer: Hi there, Yes indeed, using a Managed Load Balancer and doing your SSL termination there sounds like a good setup. This would also allow you to scale up your application in the future if needed. Another thing you coul...
    1 By tylerbeaumont123 Docker React Node.js Security DigitalOcean Managed Load Balancers
  • Question

    How to change the max filesize in media library

    I installed the strapi server on digital ocean and it works nice. But the standard configuration of the media library filesize is set to 1 MB, which is too less. How can i configure this to - let's say - 5MB per file ...
    Accepted Answer: The answer is not in the strapi configuration, but in the nginx.conf file. By default, Nginx has a limit of 1MB on file uploads. To set file upload size, you can use the clientmaxbodysize directive, which is part of ...
    2 By bstuijts JavaScript Node.js CMS
  • Question

    How can I deploy easily?

    What's a good way to deploy stuff to a DigitalOcean droplet? Right now I'm hosting my Node.js website on Cloud SQL and Google App Engine, but I'm wanting to move to DigitalOcean. My only issue is that with App Engine ...
    Accepted Answer: Hi @Dog2puppy, There are multiple tools for you to use. Let's break them down a little bit. So first, if you wish to deploy your application more code based, you can use either git/gitlab/svn etc. I'll recommend going...
    1 By Dog2puppy DigitalOcean Development Deployment Node.js
  • Question

    server return 504 when uploading file

    I'm using multer to upload the file on the server that is working perfectly on the localhost and as soon as i deploy it to digital ocean droplet and when I hit the upload-file endpoint it waits for around 30 seconds t...
    Accepted Answer: Hi @appeffie, It sounds there could be two things related to this issue. The first thing that popped in my mind while reading your question was the max execution time being hit. Additionally, what other it could be i...
    1 By appeffie Node.js Ubuntu 18.04 Nginx
  • Question

    Unable to connect to the node app

    Hi guys, I'm kinda new to all the stuff related to deployment, servers, etc. I followed tutorials explaining how to setup a Linux 18 server with nginx, and the example worked properly. However, when I redirect the pr...
    Accepted Answer: So after some research, my code was not correct, middlewares were missing. Here's the good one : var express = require('express'); var app = express(); // create our app w/ express ...
    1 By cbonnaud Deployment Node.js
  • Question

    Is it Premature for Me to Think in Terms of Hosting my "Toy" Webserver?

    During the lockdown, I have started building a "toy" Webserver on my Windows 10 laptop, using Node and Express. It is not much past "Hello World" but I can access my pages from browsers with localhost URL's. I know m...
    Accepted Answer: Hi there @shakervc, This is a great question! I don't think that this is a premature decision at all. In my opinion, it is going to be a great learning experience to deploy a Droplet, install the necessary and upload ...
    4 By shakervc Node.js
  • Question

    How do I see my node server?

    I've set up my app and it is running but after ssh-ing out of the server, now I don't know how to get access to my node server again. This is a super basic operation but I can't find the steps on how to do this anywhe...
    Accepted Answer: It depends on what article you followed to setup and install nodejs. There's the "foreground" method of running nodejs where it stays visible to you in the terminal. And like you said the log is displayed back. And th...
    1 By deltar7 Node.js Ubuntu 18.04
  • Question

    How to get a single Nodejs app to serve different content to different domain names?

    What I am trying to do is get several domain names pointing to one Nodejs app (express & next) and have unique content be served back based on which domain name it has come from. I've seen a few tutorials that are mas...
    Accepted Answer: Hello, Indeed the most straight forward way would be to just have multiple instances of the application and use Nginx server blocks for each domain name. That way you will be able o host multiple apps on one server. T...
    2 By derekkinsman Node.js