Skip to content

Instantly share code, notes, and snippets.

@dekokun
Created December 26, 2011 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dekokun/1521195 to your computer and use it in GitHub Desktop.
Save dekokun/1521195 to your computer and use it in GitHub Desktop.
Web+DB PRESS vol 64 リスト1 のJSをJSLintに対応させてみた。
/*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