├── public ├── images │ ├── Robotocat.jpeg │ ├── linktocat.jpg │ ├── vinyltocat.jpeg │ ├── snowtocat_final.jpg │ └── puddle_jumper_octodex.jpg └── css │ └── main.css ├── index.js ├── process.json ├── README.md ├── package.json ├── .github └── workflows │ └── npm-grunt.yml ├── .gitignore ├── haikus.json ├── views └── index.ejs ├── LICENSE └── web.config /public/images/Robotocat.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rise1507/haikus-for-codespaces/HEAD/public/images/Robotocat.jpeg -------------------------------------------------------------------------------- /public/images/linktocat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rise1507/haikus-for-codespaces/HEAD/public/images/linktocat.jpg -------------------------------------------------------------------------------- /public/images/vinyltocat.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rise1507/haikus-for-codespaces/HEAD/public/images/vinyltocat.jpeg -------------------------------------------------------------------------------- /public/images/snowtocat_final.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rise1507/haikus-for-codespaces/HEAD/public/images/snowtocat_final.jpg -------------------------------------------------------------------------------- /public/images/puddle_jumper_octodex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rise1507/haikus-for-codespaces/HEAD/public/images/puddle_jumper_octodex.jpg -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | let express = require('express'); 2 | let app = express(); 3 | let ejs = require('ejs'); 4 | const haikus = require('./haikus.json'); 5 | const port = process.env.PORT || 3000; 6 | 7 | app.use(express.static('public')) 8 | app.set('view engine', 'ejs'); 9 | 10 | app.get('/', (req, res) => { 11 | res.render('index', {haikus: haikus}); 12 | }); 13 | 14 | app.listen(port); -------------------------------------------------------------------------------- /process.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "worker", 3 | "script" : "./index.js", 4 | "instances" : 1, 5 | "merge_logs" : true, 6 | "log_date_format" : "YYYY-MM-DD HH:mm Z", 7 | "watch": true, 8 | "watch_options": { 9 | "followSymlinks": true, 10 | "usePolling" : true, 11 | "interval" : 5 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Haikus for Codespaces 3 | 4 | This is a quick node project template for demoing Codespaces. It is based on the [Azure node sample](https://github.com/Azure-Samples/nodejs-docs-hello-world). It's great!!! 5 | 6 | Point your browser to [Quickstart for GitHub Codespaces](https://docs.github.com/en/codespaces/getting-started/quickstart) for a tour of using Codespaces with this repo. 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app-service-hello-world", 3 | "description": "Simple Hello World Node.js sample for Azure App Service", 4 | "version": "0.0.1", 5 | "private": true, 6 | "license": "MIT", 7 | "author": "Microsoft", 8 | "scripts": { 9 | "start": "node index.js", 10 | "dev": "nodemon" 11 | }, 12 | "dependencies": { 13 | "ejs": "^3.1.8", 14 | "express": "^4.18.1" 15 | }, 16 | "devDependencies": { 17 | "nodemon": "^2.0.19" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.github/workflows/npm-grunt.yml: -------------------------------------------------------------------------------- 1 | name: NodeJS with Grunt 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | strategy: 14 | matrix: 15 | node-version: [14.x, 16.x, 18.x] 16 | 17 | steps: 18 | - uses: actions/checkout@v3 19 | 20 | - name: Use Node.js ${{ matrix.node-version }} 21 | uses: actions/setup-node@v3 22 | with: 23 | node-version: ${{ matrix.node-version }} 24 | 25 | - name: Build 26 | run: | 27 | npm install 28 | grunt 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | -------------------------------------------------------------------------------- /haikus.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "rain in seattle,\ndon't forget an umbrella,\nor it will be gloom", 4 | "image": "puddle_jumper_octodex.jpg" 5 | }, 6 | { 7 | "text": "my tunes on repeat,\nit's time for me to dj,\nhave you heard this one?", 8 | "image": "vinyltocat.jpeg" 9 | }, 10 | { 11 | "text": "snow is still falling,\nis it time for apres yet?\nlet's do one more run", 12 | "image": "snowtocat_final.jpg" 13 | }, 14 | { 15 | "text": "beep boop bop beep boop,\ni am robot octocat,\ni think there's a bug", 16 | "image": "Robotocat.jpeg" 17 | }, 18 | { 19 | "text": "same plot as before,\nso why is it still awesome?\ni think it's the hat", 20 | "image": "linktocat.jpg" 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /public/css/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #2a2b2f; 3 | display: flex; 4 | flex-direction: column; 5 | justify-content: center; 6 | font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; 7 | font-weight: 300; 8 | color: #fff; 9 | text-align:center; 10 | } 11 | 12 | .mona-images { 13 | max-width: 400px; 14 | max-height: 400px; 15 | border: 8px solid #fff; 16 | } 17 | 18 | .haiku-containers { 19 | padding: 10px 0px 20px 0px; 20 | } 21 | 22 | .haikus { 23 | font-size: 18px; 24 | white-space: pre-wrap; 25 | } 26 | 27 | @media only screen and (max-width: 600px) { 28 | .june-images { 29 | max-width: 340px; 30 | max-height: 340px; 31 | } 32 | 33 | .haikus { 34 | font-size: 22px; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /views/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |<%- haikus[i].text %>
23 |