
There are many frameworks to help you continue to develop web apps using JavaScript. As a next step, you may consider looking into further NGINX configurations to better handle serving static content and dynamic content from a reverse proxy. You have now completed the basic configurations to proxy requests to the Node.js server you wrote. You should see your site’s index.html page load.Ĭlick on the page’s Go to test.js button to load the test.js page whose content will be served dynamically with your Node.js web server.Ĭlick on the test page’s Display the date and time button to dynamically display the current date and time. Open a browser and navigate to your site’s domain or IP address.

Return to your command prompt by entering CTRL+C.Įxit your screen session by pressing Ctrl+A then d. You should see your terminal return a process ID after issuing the previous command. Appending & to the end of a command will keep the web server’s process running in the background. Navigate to your root directory where your test.js file is located. Response.end () //Signals to server thatĬonsole.log ( "Server is listening on port 3000." ) //Terminal output Response.write (file, "binary" ) //Sends body response Server response.writeHead (200 ) //Header request response #Names a server and declares the listening port
