This template provides the ability to create a basic Node.JS app with Express 3 packagesĭuring the preceding operation you can see the following dialog. So, you can get the flavor of all Visual Studio things the same as if you were getting when working with other languages like C# / ASP.NET and so on. Let's try with writing something in the server.JS file, you will see that you get Visual Studio's typical intellisence. You can find a folder structure similar to the one in the node.JS Blank console app.įigure 14: Typical folder structure of node.JS blank web app A web browser invoked with a output from the server.JS file (this is a default project file).A command window invoked this is saying that the node server is running on port 5858.The first file will open after the preceding action: Close the existing solution or just add a newer one and choose Blank Node.js Web Application template.įigure 12: Getting started with Node.JS blank web template It will install all the dependencies required for the project.Īlternatively expand the "npm" node from the Solution Explorer and right-click the project and choose Update Install Package(s), it will update all the packages with the latest.Īlso, you can do it by opening a npm install window above the option (Ctrl K,P): In the command prompt type "npm install".įigure 10: Installing node.JS project dependencies Just right-click on the project from the Solution Explorer and click on the Open Command Prompt.įigure 9: Open the command prompt from Visual Studio package.json: all about configuration, project details, version and author details and so on.app.JS: our simple node.JS stuff a JavaScript file.Here you can see that our console app consists of: Let's have a look into the folder structure:įigure 7: Typical node.JS console app folder structure That is a great thing, now we can see the output as in the following: In the preceding snippet just add the time our function to hold our window for 3000 ms. Let's re-write the code above (so we can hold our console window for a moment) as in the following: Just run the application (F5), you wil see your console window appears and disappears so quickly and you cannot see the expected output. The first file you will see has the following code:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |