How can I remove the “<pre>” tags in Hubot httpd script?
Вопрос
By default, hubot httpd.coffee script puts a pre tag in the output. Is there anyway to remove it? I'm trying to make hubot generate some basic html pages.
spawn = require('child_process').spawn
Fs = require 'fs'
module.exports = (robot) ->
robot.router.get "/", (req, res) ->
res.end "Hi, i am a <b>robot</b>!"
the output, in the web page, must be like:
Hi, i am a robot
Решение
Hubot's HTTP server is based on ExpressJS, so I suggest reading this guide: http://expressjs.com/guide.html
You can try using res.send
:
spawn = require('child_process').spawn
Fs = require 'fs'
module.exports = (robot) ->
robot.router.get "/", (req, res) ->
res.send "Hi, i am a <b>robot</b>!"
res.end()
Не связан с StackOverflow