Home > front end >  Create a variable href for html
Create a variable href for html

Time:11-25

I have the task to create a website singlehandedly and it should be somehow secure. So normally you would make an href to get images or a new html. Until now those are static. So if you would make an href="Images/001.png" you would get it, even if you would not have logged in.

My solution would be a random generated code that together with the session/login creates a path to the image. I use Node.js together with express and would like to know what the most elegant way to do this would be. At the time I programmed a File reader that searches for hrefs and overwrites them with the random generated code. After this the new formed html is returned to the client.

CodePudding user response:

Ok, i go with Quentin it is much easier.

  • Related