I'm new to node,so this maybe be a silly question but I would like to know if it is possible to implement the api passport js into my back-end express app ?
Yup: here's a tutorial on it: https://blog.risingstack.com/node-hero-node-js-authentication-passport-js/
I have found a good tutorial where I was able to get passport js to work on the back-end
https://scotch.io/tutorials/authenticate-a-node-js-api-with-json-web-tokens
Related
I’ve been learning vue and im trying to understand what app.use() is used for is it anything similar to app.use in express?
I have looked at the vue he documentation and cannot find any helpfu information
It's for using vue plugins while in express it's registering middleware.
Here is the part of the docs: https://vuejs.org/guide/reusability/plugins.html#introduction
I am new in Node.JS development. I have learned to write middlewares for Express in NodeJS. But I would like to know how can we write a middleware without using a frameworks ? Does Middlewares are specific to express ?
how to do client side routing in Markojs. Is there anything inbuild like react router as in react?
Try this npm package for client side routing with marko. marko-path-router
Try marko-router5. It's very similar react-router or vue-router.
I can try marko-cli too and create a new project. There are a full stack to create new routes, components and tests.
With the dawn of Express 4 connect is no longer a dependancy. I can't find on the express site any new implementation of csrf.
the old way was app.use(express.csrf()); and then add in a middleware function to expose it in the view.
My question is: Am I now forced to include connect as a dependency, or is there something baked into express now that allows for csrf that I am missing?
Or can I just include the source of csrf into my app?
You can install and require csurf for Express 4.
I would like to use Sails within a larger express based app. Most node.js MVC frameworks I have worked with you can mount as express middleware. Is this possible with Sails?
I want to do something like:
var express = require('express'),
app = express();
var mySailsApp = require('./mysailsapp');
app.use(mySailsApp);
While there are some active efforts to develop systems that would let Sails be more modularized, there's no way to use a Sails app as Express middleware. Sails works on top of Express, but not the other way around. However, you can use custom Express middleware with Sails--see this answer for an example.