Node.js Express EJS Site

This is a simple web application built with Node.js, Express, and EJS templating engine. The purpose of this application is to demonstrate the use of EJS's partials feature and how it can be used to create a reusable header and footer for a website.

Usage

To use this application, clone the repository and install the dependencies:

git clone https://github.com/buraktanriverdi/node-express-ejs-site.git
cd node-express-ejs-site
npm install

Then, start the server:

npm start

Open your web browser and navigate to http://localhost:3000 to see the application running.

Features

This application uses EJS's partials feature to create a reusable header and footer that are included in each page. The header and footer are stored in the views/partials directory as separate EJS files and are included in the views/index.ejs file using the <%- include('partials/header.ejs') %> and <%- include('partials/footer.ejs') %> syntax.

In addition to the header and footer, this application also includes a simple image slider and photo gallery. The slider is implemented using a separate EJS file called views/partials/slider.ejs, which displays a series of images side-by-side. The gallery is implemented using a simple grid layout, and the images are stored in the public/img directory.

Conclusion

Overall, this application serves as a simple example of how to use EJS's partials feature to create reusable components in a web application. By separating the header, footer, and slider into separate EJS files, we can keep our code organized and maintainable.