Tag: webtask

Webtask + Sendgrid =编译失败?

通过webtask.io运行: var sgMail = require("@sendgrid/mail"); module.exports = function(context, req, res) { res.writeHead(200, { 'Content-Type': 'text/html '}); res.end('<h1>Hello, world!</h1>'); }; 结果在这个回应中: { "code": 400, "message": "Compilation failed: Unexpected token {", "error": "Unexpected token {", "stack": "SyntaxError: Unexpected token {\n at exports.runInThisContext (vm.js:53:16)\n at Module._compile (module.js:373:25)\n at Module._compile (/data/sandbox/lib/module.js:127:21)\n at Object.Module._extensions..js (module.js:416:10)\n at Module.load (module.js:343:32)\n at Function.Module._load […]