ssh – i am facing problem with nextJS app development in centOS server

How actually deploy nextJS app into centos ftp server. I upload the nextJS app into public_html and run the command yarn dev or start using putty. It shows localhost:3000 and i can’t access it.
I try to deploy using nodejs deploy but also i can’t access it.. i also add index.js file in .next and also root directory.


const http = require('http');
const { parse } = require('url');
const next = require('next');

const dev = process.env.NODE_ENV !== 'production';
const app = next({ dev });
const handle = app.getRequestHandler();

app.prepare().then(() => {
    .createServer((req, res) => {
      const parsedUrl = parse(req.url, true);
      const { pathname, query } = parsedUrl;
      handle(req, res, parsedUrl);
    .listen(3000, (err) => {
      if (err) throw err;
      console.log('> Ready on http://localhost:3000');

my host name so i want to access nextJS app by[my-app-name]. but anyway if possible, there can be other ways.

Read more here: Source link