Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is Express.js' API?

have known node.js and express several days ago. I feel they are really cool, however, lacking of something.

I looked the official site, but it just point to Connect's API. But I can't find a document which teach me how to use a simple function such as expressHTTPServer.get().

Of course I read the nodejs's API, but the Express and Connect seems to extend them very much.

For example, in Express official site:

app = express.createServer();
app.get('/user/:id', function(req, res, next){
   loadUser(req.params.id, function(err, user){
     if (err)
       return next(err);
    res.send('Viewing user of csser.com ' + user.name);  }
   );
});

But sadly, no API document talk me there is expressHTTPServer.get and what it's callback arguments are.

I like to read examples, but I really need an API to learn a new language/library/framework, anyone helps?

like image 999
Lai Yu-Hsuan Avatar asked Nov 04 '22 20:11

Lai Yu-Hsuan


1 Answers

Here are the official docs: http://expressjs.com/guide.html

Also, the source can answer a lot of your questions: https://github.com/visionmedia/express

like image 160
Geoff Chappell Avatar answered Nov 09 '22 03:11

Geoff Chappell