πŸ“… 2023-04-27 β€” Session: Configured local web server for Nunjucks site

πŸ•’ 16:45–17:15
🏷️ Labels: Nunjucks, Node.Js, Http-Server, Web Development
πŸ“‚ Project: Dev
⭐ Priority: MEDIUM

Session Goal: The session aimed to set up a local web server to serve a static site generated with 11ty and Nunjucks, ensuring proper configuration for viewing .njk files in a browser.

Key Activities:

  • Developed a Nunjucks template for generating an XML sitemap in an 11ty project.
  • Set up a local web server using Node.js and the http-server package.
  • Configured the server to serve .njk files correctly, preventing them from being downloaded.
  • Installed Node.js and configured environment variables to ensure the node command is accessible from any terminal location.
  • Provided solutions for common issues like the β€˜npm command not found’ error and server access troubleshooting.

Achievements:

  • Successfully set up a local server environment to serve and view the static site, including .njk files, in a browser.
  • Resolved installation issues and ensured proper configuration of Node.js and npm.

Pending Tasks:

  • Further testing of server configurations to ensure compatibility with other file types and server settings.