Nodejs personal website construction experience sharing-routing Rule Design (1)
During the winter vacation, I worked as an intern in a company to develop web applications on the nodejs platform. The first time I learned nodejs, I felt that this little thing really has infinite potential. Nodejs is used as the server-side platform, with a small amount of code, but powerful and diverse module support. So I plan to build a personal website in my spare time. This serialized article is used to share your experience with you. My personal website uses the express framework of nodejs platform and MYSQL database. The Web Front-end UI uses the open-source bootstrap framework on the Internet. The express version is 4.11.0. A website consists of three main pages: blogs, projects, and contact blogs. The first section of each article is displayed. Click "article" on the page after the article and use the hidden login interface to log on to the Administrator. The preliminary plan for website routing is as follows: the '/' and '/blogs' path requests are rendered using the blog. ejs file. The three path requests of '/login','/Project', and '/contact' are rendered using the login. ejs, project. ejs, and contact. ejs files respectively. '/Blogs/articla/: articlenum' path request to use the article. ejs file for rendering. The articleNum variable represents the id of each blog article. The projects page has not been designed yet. Blogs. in ejs, the html code used to display each thumbnail article is as follows: <div class = 'blog-container'> <div class = 'row'> <div class = 'col-lg-3 '>