1. Install VS code at https://code.visualstudio.com/
2. Install NVM: Windows: https://github.com/coreybutler/nvm-windows Direct download link for PC: https://github.com/coreybutler/nvm-windows/releases/download/1.1.12/nvm-setup.exe
3. Open VScode, hit file, open folder, create a new folder and give the folder a name.
4. Enter a new terminal
5. Write nvm install 20.12.0
6. Write nvm use 20.12.0
What you need to start building with nodeJS (Mac)
1. Install VS code at https://code.visualstudio.com/
2. Create a new folder in VS code and open a new terminal
3. Install nvm using homebrew: (How To Guide) https://sukiphan.medium.com/how-to-install-nvm-node-version-manager-on-macos-d9fe432cc7db
4. Install NVM using Homebrew
5. Write nvm install 20.12.0
6. Write nvm use 20.12.0
1. Open your project folder is VS Code and create a new file
2. Name the new file "index.js" and save it in your project folder.
3. Add some basic code to our "index.js" file. Type `console.log('hello');` into the file and save it.
4. Open your terminal or command prompt and navigate to your project folder.
5. In the terminal, type `node index.js` and press Enter. You'll see the word "hello" printed in the terminal. This means Node.js successfully ran your code from the "index.js" file.
6. Also type “node .” in the terminal and press enter, which implicitly runs the default file in the current directory, which is "index.js" in our case. Again, we’ll see "hello" printed in the terminal.
1. Open the terminal.
2. Type npm “init -y” and press Enter. This command initializes a new file called package.json. This file keeps track of the dependencies your project uses.
3. Next, install a dependency called express. Type “npm install express” in the terminal and press Enter. npm will download and install express. After the installation, you'll notice a new folder called “node_modules” in your project directory. This folder contains all the dependencies required by your application.
This tutorial will show you how to create a simple website in nodejs, deployable on Evernode.
1. Run npm init to initialize your project.
2. Install Express with npm i express.
3. Create a folder named public. This will hold your website files.
4. Inside public, create a file called index.html and add the text Hello World.
5. In the base directory (outside the public folder), create a file called index.js.
6. Open index.js and paste the server code. Note: the ports 36525, 36527, and 36529 are standard Evernode ports used for web listeners. The paths KEY_PATH and CERT_PATH are where Evernode stores SSL certificates.
Server code available here: https://pastebin.com/AyW0AVA1
7. In your terminal, make sure you’re in the same folder as index.js, then run node index.js. You’ve now started the webserver! Since it’s running locally, it will use http. On Evernode, it will use https.
8. Open your browser and go to http://localhost:36525 to view your website.
Pre-requisites:
Install NPM
Install Node.js