简体   繁体   English

如何删除“ <pre> ”标记在Hubot httpd脚本中?

[英]How can I remove the “<pre>” tags in Hubot httpd script?

By default, hubot httpd.coffee script puts a pre tag in the output. 默认情况下,hubot httpd.coffee脚本在输出中放置一个前置标记。 Is there anyway to remove it? 反正有删除它吗? I'm trying to make hubot generate some basic html pages. 我正在尝试使hubot生成一些基本的html页面。

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 网页中的输出必须类似于: Hi, i am a robot

Hubot's HTTP server is based on ExpressJS, so I suggest reading this guide: http://expressjs.com/guide.html Hubot的HTTP服务器基于ExpressJS,因此我建议您阅读此指南: http ://expressjs.com/guide.html

You can try using res.send : 您可以尝试使用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()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM