To create a Node server in your server.js file, you will need the following code: const http = require('http') Ĭonst server = http.
Let's see step by step how to start a Basic Server! You can use the default options, or change them as you wish - however, your entry point should be server.js , which you will create shortly.Ĭreate a server.js file inside your back-end folder - this will contain your first Node server. If, unlike me, you create the Git repo first, you can add the URL to the remote repo to your Node project during creation.įrom within your backend directory, run the terminal command npm init to initialize the project. gitignore file containing the line node_modules to avoid pushing this large folder to your remote repo. How to do mongoDB configuration, logs and server setup. Let's see in the next video how to initialize your project! īefore you start, you can initialize a Git repo by running git init from within your back-end folder. In this tutorial, we are going to discuss how to install MongoDB on Windows operating system. For example, it also adds functionalities that normal browser JavaScript doesn't have, like access to the local file system.Įxpress is a framework that sits on top of Node and makes Node servers much easier to build and maintain, as you will see as you advance through this course.
Node is the runtime that allows you to write all your server-side tasks in JavaScript, like business logic, data persistence, and security. Before jumping in and writing code, let's take a moment to go over Node and Express.