Here is my Issue:
I have a Node web application that is responsible for user authentication. Once the user has successfully logged in they are presented with a personalised page which contains secure links to files. Here is my file structure.
secure/
is where my files are hosted
The application itself is only around 7mb.
The files for these users are around 600mb
I have two pretty high-level questions to ask.
Should I be using express.js for this? I have a feeling Node.js doesn't shine in this scenario and I've had a lot of difficulty searching for tutorials for more complex user authentication (user groups/roles). RoR?
Should my files sit outside of the application? In a database? s3 bucket? At the moment I have set up a static route to a folder that sits within the application directory called secure
, I then have some middleware that checks all requests to secure/
and checks if the user is authorised (see code below). I'm asking this as I have a limit of 512mb uploads with Elastic Beanstalk
app.all('/secure/*', function(req, res, next) { if (req.isAuthenticated()) { next(); // allow the next route to run } else { // require the user to log in res.redirect("/"); } }); app.use('/secure', express.static(config.root + '/secure'));
Even if someone could provide me some resources that would be great! Thanks