And we also have initial_path which is holding our public folder path.Īfter that we have, app.use() which is used as a middle ware And inside this we have express.static() which allow us to set our static directory path. We are setting a variable app equal to express(), which enable all the server related features to our app variable. We are importing two libraries express and path.Īfter done importing libraries. In the top, we are using require method to import library so that we can use it in this file. Run this command.Įnter fullscreen mode Exit fullscreen mode Great Now install Some libraries that we need in order to create a server.Īfter creating package.json file. After executing npm init you should see a package.json file. You can press enter to have default project details. So outside public folder, In your root directory, open Command Prompt or terminal. So let's start with its folder structure. We need NPM and Node.js in order to start with, so make sure you have them installed in your system. So, without wasting more time let's see how to code this.Īs this is a node.js web app. I appreciate if you can support me by subscribing my youtube channel. To see demo or you want full coding tutorial video.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |