Create New Page

How to create new page?

Let's create new page named test. create new route for page in routes/routes.js like below.

route.get('/test-page', (req, res, next) => {
    res.render('test-page', { title: 'Test Page'});
})

After adding routes create new controller in admin/controllers/* folder.

TestController.js

After adding controller create new model in admin/models/* folder.

TestModels.js

Now time to make view of test page. create test-page.ejs in admin/views/ directory and add below code.

<%- contentFor('HeaderCss') %>
<%- contentFor('body') %>
<%- contentFor('FooterJs') %>

How to add new dependency?

Let's add new module named simplebar. Install Simplebar using below command.

npm install simplebar --silent

and then run below command.

npm run build

and then run below command.

npm start
© Velzon.
Design & Develop by Themesbrand