node.js - AngularJS NodeJS HTTPS requests -


i'm beginner in https & developed express example based on certificate & key :

server = https.createserver(https_options, app).listen(port, host); 

where https_options upmentioned security mechanism. question is: how can authenticate angularjs services/factories when i'm calling expressjs api routes. e.g.: routes.js :

app.get('/home', function(req, res) {     res.send('welcome') }) 

angular factory :

$http.get('/home').success(function(){}).error(function(){}) 

a simple example work me :) lot !

here article using both node express , angularjs.

this article uses token based authentication. authentication not happen in angular app, happens in node, angular app needs know how communicate node api authenticate users.

with token based authentication, in case json web tokens, token sent api on every request. api verify token's authenticity , either grant or deny access user making request.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -