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.
593 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 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

    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

    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...
    1 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

    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

    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

    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

    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

    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

    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
  • 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

    Presigned URL SignatureDoesNotMatch on Digital Oceans Spaces

    Hi all. I'm new to spaces and I can't seem to get a valid Pre-signed URL with this code. If anyone has pointers or corrections I would really appreciate it. I have also added a wildcard CORS with all permissions. ``` ...
    Accepted Answer: Hi @robbat2, the pre-signed URL is going to be used for directly uploading file content of images. Was trying to make a URL that did not need the content-type, but found out yesterday that the content-type was all tha...
    2 By SkippyBit DigitalOcean Node.js
  • Question

    Npm WARN saveError ENOENT- package.json not found

    Hello, Except 2 times, I am getting this error and i don't remember what i did or what i run commands to work it out. Here is/are problems i am having; Screenshot 1 (https://s17.postimg.org/gi4gehgdb/package_json_pop...
    Accepted Answer: Run the following: npm init -y That will create the package.json file which you can edit later with proper information.
    1 By Kayrah Node.js Applications CentOS
  • Question

    How to serve two node.js apps on one domain? Site #2 accessible through localhost but not through url. (Nginx)

    I am attempting to run two node.js applications from the same droplet, off the same url. I am serving the first app from http://finleywill.com (http://finleywill.com), and would like to serve the second app from http:...
    Accepted Answer: I figured it out with help from a friend! ...as per https://serverfault.com/questions/650117/serving-multiple-proxy-endpoints-under-location-in-nginx (https://serverfault.com/questions/650117/serving-multiple-proxy-en...
    1 By finleywilliamson Nginx Node.js Ubuntu 18.04
  • Question

    MySQL crashes when my pods connects

    I created a Kubernetes cluster in Digital Ocean. The cluster has one node pool with 3 4GB memory / 2vCPU nodes. I have linked GitLab CI to the cluster following the GitLab documentation (https://gitlab.com/help/user/p...
    Accepted Answer: It turns out setting fullnameOverride for my application in the Helm chart solved the issue. If it is too long, the MySQL pod crashes when my application pod tries to connect to it. I still have no clue why this cause...
    1 By remcohaszing MySQL Node.js
  • Question

    "Signature Does Not Match" when putting to presigned spaces upload url

    I am using the aws-sdk in Node.js to generate a presigned putObject upload url for use with DigitalOcean Spaces. The url gets generated just fine, however when I try putting to it using a REST client, I get a Signatur...
    Accepted Answer: So the reason this wasn't working is the content type MUST be specified when generating the presigned URL and specified once again by the client when it connects, and they must exactly match. Once I specified applicat...
    4 By sam0x17 DigitalOcean JavaScript Node.js