NPM continues to run smoothly in support of the Hastebin server operations

I have set up Hastebin at /var/www/paste/hastebin/

To initiate the NPM server, I need to navigate to the hastebin directory and then execute:

npm start

This command starts the server with the following output:

# npm start

> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bad2dbc9cedffa8a948b948a">[email protected]</a> start /var/www/paste/hastebin/
> node server.js

info: compressed application.js into application.min.js
info: loading static document name=about, path=./about.md
info: listening on 0.0.0.0:7777
debug: loaded static document success=true

If I disconnect from my ssh session, I lose access to example:7777

How can I ensure that the server keeps running even after I disconnect?

Answer №1

If you want to maintain the session active, my recommendation is to install screen

You can execute screen to launch a terminal session that operates "Behind the Scenes." After running the npm start command, just press CTRL+AD to detach from the screen session.

At this point, your service should be up and running in the background.

I hope this information proves useful!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Having trouble setting up create-react-app on my Windows 10 machine

Struggling with installing create-react-app on my Windows 10 operating system. I've meticulously followed the given steps, however, the installation process seems to never-ending and eventually comes to a halt. Here's a breakdown of the steps I t ...

Express identifies the user, however, the username is displayed exclusively on one specific page. This situation may indicate a potential cookie problem

I am in the process of developing an express app integrated with MongoDB. The issue I am facing involves a pug template for the navigation bar where I aim to display the user's name at the top upon logging in. Strangely, it only works on the page that ...

Tips for maximizing the performance of my Heroku web application

As a beginner in web development, I am currently working on creating my own portfolio website. My website utilizes node, express, and Heroku to go live online. However, I am facing some challenges as the page does not scroll smoothly and the animations are ...

What is the best way to identify and recover two separate client socket connections from the same user after a server restart?

Picture this scenario: A customer opens a browser tab and goes to page-x. As the customer remains on this page, I send out data through a socket specific to this page, which we'll call socket-context-x. Next, the customer opens another browser tab ( ...

Obtain the current URL in a Node.js configuration file

In my application using the express framework, I have the following code in my app.js file: var express = require('express'); var app = module.exports = express(); var config = require('./config.js')(app, express); // Including ...

ExceptionError: Unable to access the startsWith property of an undefined value

import React from 'react'; import AttributeDescription from './AttributeDescription'; class CompEntry extends React.Component{ render(){ let modifiedDescription; if(this.props.description.startsWith("_")){ modifiedD ...

What could be the reason behind the absence of $_SERVER['ORIG_PATH_INFO']?

MAIN_ROOT/files/test.php includes the script below and is accessed through https://example.com/updates/test.php/some/stuff?foo=bar <?php echo('PATH_INFO: '.($_SERVER['PATH_INFO']??'UNSET').PHP_EOL); echo('ORIG_PA ...

How can I retrieve a text file using an API in a Next.js application?

Is there a way to download a text file using an API in Next.js? The console.log(ninjas) function is already displaying the correct information. I have tested the API with Postman and it works perfectly. When I use GET in Postman, the same information is ...

Navigating to various destinations

I'm currently learning about node.js and express.js. I wanted to create a registration and login page, but I've encountered an issue. After displaying a success alert message, I can't seem to redirect back to the welcome page without getting ...

Collaborating on validating inputs and modules for both backend and frontend

Sharing input validation is crucial for various reasons: Immediate feedback to users on the frontend regarding the validity of their input Enhanced security measures in the backend, preventing manipulation of data through the API Dependency on frontend J ...

req.user is limited to containing only the username field

I recently started using passport js and encountered an issue. When I console.log req.user, it only displays the username field as {username: 'a'}. Other fields like email are not shown in the output. Below is the content of index.js file: const ...

What sets apart the following: ( import React from "react"; ) and ( import React from 'react'; )?

When it comes to imports, is there a distinction between using single quotes (') versus double quotes ("), for example in import React from 'react'; and import React from "react";? Are there any notable differences? ...

Receiving a blank string after calling fs.readFile within the chokidar.watch(path_file).on('change', ...) function

This is my current Node project setup: https://github.com/tlg-265/chokidar-issue https://i.stack.imgur.com/qYKlR.png $ git clone https://github.com/tlg-265/chokidar-issue $ cd chokidar-issue $ npm i $ npm run watch-changes The project monitors changes ...

Permission denied: unable to perform operation due to EPERM error and open access restriction

My React application has been up and running smoothly for some time, but recently I encountered an error when trying to make edits. The error message reads: "ERROR in EPERM: operation not permitted, open 'C:\Users\Administrator\Desktop& ...

Is it possible to develop a Strapi plugin in real-time without the need to continuously rebuild the plugin?

Currently, I am in the process of developing a plugin for Strapi. I'm curious if there is a way to streamline the development process by having my Strapi backend automatically detect any changes made to the plugin's code without the need to run ...

Save Konva as an image on the server without the need for rendering

I have a specific template that allows users to change the image within it, triggering the server to generate a new image automatically. This is the main goal I am aiming for. Previously, I created a JSON file from the template. Now, I am looking to expor ...

Is there a way to monitor individual users in the application based on their session, allowing for unique sets of redirects or rules for each user?

I am currently developing a URL shortener similar to Bitly, with all functionalities on a single page. The page includes a form where users can input the URL they want to shorten and a section displaying all abbreviated URLs associated with that user (with ...

The call stack in mongodb has surpassed its maximum size limit

I am currently executing a method. Method execution var message = "Hello" function1("78945612387", message, null, "Portalsms") Node JS Code function function1(mobileno,body,logExtraInfo,messageType){ request(uri, function (error, resp ...

Output various strings to the standard output and stream them individually

Is there a way to redirect each string output to standard out to another command? // Example file: example.js #!/usr/bin/env node process.stdout.write('foo') process.stdout.write('bar') After running ./example.js | wc -m, the total ch ...

What are the best practices for integrating Quill with Node.js and MongoDB?

I'm in the process of creating my own blog, and I really want to have a user-friendly interface for updating the content instead of manually editing HTML files each time. My plan is to use the Quill editor to create blog posts (which are saved as del ...