Skip to content

Instantly share code, notes, and snippets.

@zach-is-my-name
Created December 14, 2016 20:34
Show Gist options
  • Save zach-is-my-name/aaa2c6d785cae88884f44acb89238ac2 to your computer and use it in GitHub Desktop.
Save zach-is-my-name/aaa2c6d785cae88884f44acb89238ac2 to your computer and use it in GitHub Desktop.
ExpressDrills2.js
'use strict';
// Request and response object drills
// ==================================
const express = require('express');
const app = express();
// your code here.
app.get('/:adjective1/:adjective2/:adjective3/:verb/:name/:noun/:place/:adverb', function(req,res) {
var adjectiveOne = req.params.adjective1;
var adjectiveTwo = req.params.adjective2;
var adjectiveThree = req.params.adjective3;
var verb = req.params.verb;
var name = req.params.name;
var noun = req.params.noun;
var adverb = req.params.adverb;
var place = req.params.place;
res.send(`There's a ${adjectiveOne} new ${name} in ${place} and everyone's talking.
Stunningly ${adjectiveTwo} and ${adverb} ${adjectiveThree}, all the cool kids know it.
However, ${name} has a secret - ${name}'s a vile vampire.Will it end with a bite,
or with a stake through the ${noun}?`);
});
// listen for requests :)
app.listen(process.env.PORT || 8080, () => console.log(
`Your app is listening on port ${process.env.PORT || 8080}`));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment