Run a sample app
git clone https://github.com/visionmedia/express.git
cd express
npm install
node examples/ejs/index.js
Then try this
curl -v -k "http://localhost:3000/no5_such3_file7.pl?\">"
<?php | |
function curl_get($url) | |
{ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_TIMEOUT, 10); | |
$output = curl_exec($ch); | |
curl_close($ch); |
Run a sample app
git clone https://github.com/visionmedia/express.git
cd express
npm install
node examples/ejs/index.js
Then try this
curl -v -k "http://localhost:3000/no5_such3_file7.pl?\">"
'use strict' | |
var cluster = require('cluster'), | |
http = require('http'), | |
os = require('os'), | |
fs = require('fs'); | |
function Master(options) { | |
this.options = options; |
start = fieldName; | |
fieldName = selector ('.' selector)* | |
selector = word '[' (numOfexpr/ ('"' qword '"') / ('\'' qword '\'')) ']' / word / '@' | |
word = chars:([a-zA-Z$:][a-zA-Z_0-9:]*) { | |
var ret = chars[0]; | |
for(i = 1; i < chars.length; i++) { |
function probe(cb) { | |
var wsCtor = window['MozWebSocket'] ? MozWebSocket : WebSocket; | |
var socket = new wsCtor(uri, 'blah'); | |
socket.onopen = function () { | |
// Send a probe | |
socket.send(JSON.stringify({ | |
type: 'probe', | |
data: {} | |
})); | |
}; |
/tmp> cat test.js | |
"use strict" | |
a = 'b'; | |
/tmp> node test.js | |
node.js:134 | |
throw e; // process.nextTick error, or 'error' event on first tick | |
^ |
Hello World |
function main(app){ | |
app.get('/', function(req, res) { | |
... | |
}); | |
app.put('/', function(req, res) { | |
... | |
}); | |
app.delete('/', function(req, res) { | |
... | |
}); |
var sys = require('sys'), | |
express = require('express'), | |
resource = require('resource-router'); | |
var app = express.createServer(); | |
app.set('views', __dirname + '/views'); | |
// resource-router | |
function main(app) { | |
app.resource('/', { |