-
-
Save chrisseaton/8e4fb0aa1503c2d441b7251f18e119c8 to your computer and use it in GitHub Desktop.
This file contains 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
var express = require('express'); | |
var app = express(); | |
color_rgb = Polyglot.eval('ruby', ` | |
require 'color' | |
Color::RGB | |
`); | |
app.get('/css/:name', function (req, res) { | |
color = color_rgb.by_name(req.params.name).html() | |
res.send('<h1 style="color: ' + color + '" >' + color + '</h1>'); | |
}); | |
app.listen(8080, function () { | |
console.log('serving at http://localhost:8080') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment