summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGianni Ceccarelli <gianni.ceccarelli@broadbean.com>2018-02-21 17:15:53 +0000
committerGianni Ceccarelli <gianni.ceccarelli@broadbean.com>2018-02-21 17:15:53 +0000
commit0c5ee0c8d7d7b14ecae313c935605788ed1327ed (patch)
tree5637a411c8ffb111e871b95079ecd561425563f0
parentpackage lock (diff)
downloadcolor-0c5ee0c8d7d7b14ecae313c935605788ed1327ed.tar.gz
color-0c5ee0c8d7d7b14ecae313c935605788ed1327ed.tar.bz2
color-0c5ee0c8d7d7b14ecae313c935605788ed1327ed.zip
set filepath as well
-rw-r--r--index.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/index.js b/index.js
index bb6f4e0..b6074d3 100644
--- a/index.js
+++ b/index.js
@@ -9,11 +9,12 @@ highlighter.requireGrammarsSync({
const server = http.createServer((req, res) => {
const filename = req.headers['filename'];
let buffer = '';
- res.setHeader('Content-type','text/plain');
+ res.setHeader('Content-type','text/html; charset=utf-8');
res.statusCode = 200;
req.on('end', () => {
highlighter.highlight({
"scopeName": filename,
+ "filePath": filename,
"fileContents": buffer,
}, (err,html) => {
res.write(html, '', () => { res.end() });