Created
December 26, 2011 13:43
-
-
Save dekokun/1521195 to your computer and use it in GitHub Desktop.
Web+DB PRESS vol 64 リスト1 のJSをJSLintに対応させてみた。
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
/*global require, console */ | |
/*↑上記のように記述しないと、「'require' was used before it was defined.」とか怒られる。さすがに阿呆らしい */ | |
var http = require('http'); | |
http.createServer(function (req, res) { | |
'use strict'; | |
/* ↑ これがないと「Missing 'use strict' statement.」。最近のブラウザってどれくらいstrictモードに対応しているんですか? */ | |
res.writeHead(200, { 'Content-Type': 'text/plain' }); | |
res.end('Hello World!'); | |
}).listen(1337); | |
console.log('server listening on port 1337'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment