Revision as of 21:23, 3 October 2024 by KazVee (talk | contribs) (Created page with "== Next.js == == About Next.js == [https://nextjs.org/ Next.js] is a popular full stack framework for node.js, it utilizes React for frontend and is packed with awesome features like server-side rendering. It also includes API routes and much more. == Node.js Server Resource Usage == If you use Node.js, we strongly recommend that you [https://heliohost.org/dashboard/load/ monitor your site load here]. Node apps often require a lot of server resources, and exceeding...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Next.js

Next.js

About Next.js

Next.js is a popular full stack framework for node.js, it utilizes React for frontend and is packed with awesome features like server-side rendering. It also includes API routes and much more.

Node.js Server Resource Usage

If you use Node.js, we strongly recommend that you monitor your site load here.

Node apps often require a lot of server resources, and exceeding the account load limits will cause your user account to be suspended for high server usage.

== Setup

Go into your project root (if you don't have a project, learn how to create one here)

Create a new file called `start.js` and put this inside:

const path = require('path');
const nextPath = path.join(__dirname, 'node_modules', '.bin', 'next');

process.argv.length = 1;
process.argv.push(nextPath, 'start');

require(nextPath);

Server setup

Upload all your files to your Tommy server. Then go to the Node.js section and set the following:

  • Node.js Version: At least 14.21.0 (though we highly recommend using the latest one: `17.9.1`)
  • Application Root: / (Folder where you uploaded your next project, we recommend `/`)
  • Application Startup File: `start.js` (the file created earlier)
  • Custom environment variables: `PORT = 8888`
  • Optionally: Custom environment variables: `NODE\_ENV = production`

Starting the server

Once all of the above steps are done, you can press the `Enable Node.js` button.

Then you need to press the `NPM install` button.

And then `Run script`, Script name: `build`

After that finishes, you will need to wait up to 2 hours for the server to update.

Node.js application deployment can take up to 2 hours to go into effect as it requires an Apache restart. After an entire 2 hours, if your Node app is not working for you, please clear your web browser cache.


This page was last edited on 3 October 2024, at 21:23.