There's more...

Express can also generate projects that are preconfigured to use different view and style frameworks. We will do virtually all our front-end development inside our Angular application, but it isn't uncommon for certain pages in web applications to be served using traditional server-side page rendering.

If you want to configure your Express application to use the same handlebars, view templates, and Sass styles that we use in our Angular project, simply provide these options as flags to express-generator:

express my-express-project --css sass --view hbs

This will make any frontend template work you do in Express very similar to the work we have done in Angular. It's also worth noting that this configuration defaults to using the .sass extension flavor of Sass. If you want to use .scss, such as in your Angular recipes, you will need to tweak your /app.js file's sassMiddleware configuration, as follows:

app.use(sassMiddleware({
src: path.join(__dirname, 'public'),
dest: path.join(__dirname, 'public'),
indentedSyntax: false, // true = .sass and false = .scss
sourceMap: true
}));
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.102.34