![]() ![]() Background: HD188553, NASA/JPL-Caltechįollowing the parameterized route the guardian. The following code sets up a simple HTTP server with Express.js.Ĭonsole.log(`Server started at port $`) The example below defines block scripts, block content. They are all mapped directly to Pug options, unless pointed out. The following options are available to be set for the loader. Check the webpack documentation on how to do that for CLI and for configuration files. Providing default content is purely optional, though. If you are using includes, you must make sure that. Pug blocks can provide default content, if appropriate. In a template, a block is simply a block of Pug that a child template may replace. It will be created after the author and license fields are over. Template inheritance works via the block and extends keywords. If you want some other name, like app.js, you can do the naming here. Now there is one field called entry point where you can give a name to your main file (. Inside /node-project, we will create the package.json file for our Node.js + Express.js application typing the below command.įill the name, version, description and other such fields with your own values. ![]() Call that resultant function with your data, and voil, it will return a string of HTML rendered with your data. pug.compile () will compile the Pug source code into a JavaScript function that takes a data object (called locals ) as an argument. Create a working directory for your project, say, /node-project. The general rendering process of Pug is simple. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |