Express.js
Przydatne linki
- Tworzenie RESTful API z CRUD na przykładzie prostego modelu niedźwiedzi
- Wstęp do MEAN stack i bardzo dobrze opisany kod Angulara
-
Uwierzytelnianie
- Uwierzytelnianie użytkownika RESTful API za pomocą JSON Web Token - part 1 backend
- Easy Node Authentication: Setup and Local
- Easy Node Authentication: Facebook
- Easy Node Authentication: Linking All Accounts Together
- Uwierzytelnianie RESTful API za pomocą
passport-facebook
orazpassport-http-bearer
- User Authentication with the MEAN Stack
-
Testowanie
- Dokumentacja Express 4.x
Middlewares
Przykład middleware:
var express = require('express');
var app = express();
function queryRemover(req, res, next){
console.log("\nPrzed zmodyfikowaniem adresu URL: ");
console.log(req.url);
req.url = req.url.split('?')[0];
console.log("\nPo zmodyfikowaniu adresu URL: ");
console.log(req.url);
next();
};
app.use(queryRemover);
app.get('/no/query', function(req, res) {
res.send("test");
});
app.listen(80);