├── .gitignore ├── LICENSE ├── README.md ├── gulpfile.js ├── haikus.json ├── index.js ├── package-lock.json ├── package.json ├── process.json ├── public ├── css │ └── main.css └── images │ ├── Robotocat.jpeg │ ├── linktocat.jpg │ ├── puddle_jumper_octodex.jpg │ ├── snowtocat_final.jpg │ └── vinyltocat.jpeg ├── views └── index.ejs └── web.config /.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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Haikus for Codespaces 3 | 4 | This is a quick node project template for demoing Codespaces. It is based off of the [Azure node sample](). It's great!!!. 5 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const imagemin = require('gulp-imagemin'); 3 | 4 | exports.default = () => ( 5 | gulp.src('./raw_images/*') 6 | .pipe(imagemin()) 7 | .pipe(gulp.dest('./public/images')) 8 | ); -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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); -------------------------------------------------------------------------------- /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.0.1", 14 | "express": "^4.17.1", 15 | "nodemon": "^2.0.2" 16 | }, 17 | "devDependencies": { 18 | "gulp": "^4.0.2", 19 | "gulp-imagemin": "^7.1.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /public/images/Robotocat.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdullahthewebbee/Codespace_test-main/e0f60554ad7ea7f290e842a0d7a8bff324bea186/public/images/Robotocat.jpeg -------------------------------------------------------------------------------- /public/images/linktocat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdullahthewebbee/Codespace_test-main/e0f60554ad7ea7f290e842a0d7a8bff324bea186/public/images/linktocat.jpg -------------------------------------------------------------------------------- /public/images/puddle_jumper_octodex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdullahthewebbee/Codespace_test-main/e0f60554ad7ea7f290e842a0d7a8bff324bea186/public/images/puddle_jumper_octodex.jpg -------------------------------------------------------------------------------- /public/images/snowtocat_final.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdullahthewebbee/Codespace_test-main/e0f60554ad7ea7f290e842a0d7a8bff324bea186/public/images/snowtocat_final.jpg -------------------------------------------------------------------------------- /public/images/vinyltocat.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdullahthewebbee/Codespace_test-main/e0f60554ad7ea7f290e842a0d7a8bff324bea186/public/images/vinyltocat.jpeg -------------------------------------------------------------------------------- /views/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |<%- haikus[i].text %>
23 |