Skip to content

Instantly share code, notes, and snippets.

View Octagon-simon's full-sized avatar
Turning red flags into red tests that pass.

Simon Ugorji (Octagon) Octagon-simon

Turning red flags into red tests that pass.
View GitHub Profile
//import express
const express = require('express')
//import ejs
const ejs = require('ejs')
//load express
const app = express()
//set port number
const port = 5000
//tell express to use ejs as our template/view engine
app.set('view engine', 'ejs')
//listen on the port number
app.listen( port, () => {
console.log("App is live")
})
//route to homepage
app.get( '/', (req, res) => {
//render the template for the homepage
res.render('home');
})
<!Doctype html>
<html>
<head>
</head>
<body>
<header>
</header>
<main>
<h1 style="text-align:center">Welcome</h1>
</main>
//tell express to use ejs as our template/view engine
app.set('view engine', 'ejs')
//tell express to use pages as our views directory
app.set('views', './pages')
//import express
const express = require('express')
//import ejs
const ejs = require('ejs')
//load express
const app = express()
//set port number
const port = 5000
function unscramble(word) {
//import dictionary
const dict = require('an-array-of-english-words');
//return the result of our logic
return(
dict.filter( item => {
//handle reoccurrences
const reOccurrence1 = {}
const reOccurrence2 = {}
//check if their lengths are equal
function unscramble(word) {
//import dictionary
const dict = require('an-array-of-english-words');
//return the result of our logic
return(
dict.filter( item => {
//handle reoccurrences
const reOccurrence1 = {}
const reOccurrence2 = {}
//check if their lengths are equal
function unscramble(word) {
//import dictionary
const dict = require('an-array-of-english-words');
//return the result of our logic
return(
dict.filter( item => {
//handle reoccurrences
const reOccurrence1 = {}
const reOccurrence2 = {}
//check if their lengths are equal
function unscramble(word) {
//import dictionary
const dict = require('an-array-of-english-words');
//return the result of our logic
return(
dict.filter( item => {
//check if their lengths are equal
if(item.length === word.length){
//logic continuation here
}