Skip to content

mhan8796/codespaces

Repository files navigation

Haikus for Codespaces

A small Express and EJS demo app that renders a set of Octocat-themed haikus with matching images.

This project started from the Azure App Service Node.js sample and is set up as a lightweight Codespaces-friendly Node app.

Features

  • Express server with EJS views.
  • Haiku data loaded from haikus.json.
  • Static CSS and image assets served from public/.
  • Azure/IIS deployment configuration in web.config.
  • Optional image optimization task in gulpfile.js.

Requirements

  • Node.js
  • npm

This repo has been checked locally with Node.js v22.22.3 and npm 10.9.8.

Getting Started

Install dependencies:

npm ci

Start the app:

npm start

Open:

http://localhost:3000

For development with file watching:

npm run dev

Editing Haikus

Haikus are stored in haikus.json:

{
  "text": "rain in seattle,\ndon't forget an umbrella,\nor it will be gloom",
  "image": "puddle_jumper_octodex.jpg"
}

Images referenced in haikus.json should exist in public/images/.

Project Structure

.
|-- index.js              # Express app entry point
|-- haikus.json           # Haiku text and image filenames
|-- views/index.ejs       # Rendered page template
|-- public/css/main.css   # Page styles
|-- public/images/        # Image assets
|-- gulpfile.js           # Optional image optimization task
|-- process.json          # Process manager config
`-- web.config            # Azure/IIS config

Public Release Checklist

Before listing this repository publicly, review these items:

  • npm audit currently reports 86 vulnerabilities, including 3 critical, 53 high, 17 moderate, and 13 low. The direct packages most visibly involved are old versions of ejs, express, nodemon, gulp, and gulp-imagemin, plus their transitive dependencies.
  • package.json has "private": true. That is fine for a public GitHub repo, but it blocks publishing to npm.
  • package.json still uses the original sample metadata: package name app-service-hello-world, description Simple Hello World Node.js sample for Azure App Service, and author Microsoft. Update these if this repo should represent your project.
  • LICENSE is MIT and still names Microsoft Corporation. Confirm that attribution is intentional before publishing under your own account.
  • public/css/main.css has a mobile rule for .june-images, but the template uses .mona-images, so the mobile image sizing rule does not apply.
  • There are no automated tests configured.
  • package-lock.json was generated by an older npm version and causes old-lockfile warnings during install.

Verification

Latest local checks:

  • npm ci completed successfully.
  • npm start served the app.
  • curl -I http://127.0.0.1:3000 returned HTTP/1.1 200 OK.
  • Secret scan found no obvious committed secrets; the only app hit was process.env.PORT.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors