Created
January 12, 2017 03:19
-
-
Save ishiduca/f0d428d596d0c7dc2e693dac7a5a52e8 to your computer and use it in GitHub Desktop.
server side yo-yo yo-yo.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const yo = require('yo-yo') | |
const url = require('url') | |
const http = require('http') | |
const app = http.createServer((req, res) => { | |
const q = url.parse(req.url, true).query | |
res.setHeader('content-type', 'text/html; charset=utf-8') | |
res.end(String(yo `<body><main><h1>${q.test}</h1></main></body>`)) | |
}) | |
app.listen(9966) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment