Find Jobs
Hire Freelancers

MongoDB and NodeJS: help route API keys dynamically -- 2

$30-250 USD

Käynnissä
Julkaistu lähes 4 vuotta sitten

$30-250 USD

Maksettu toimituksen yhteydessä
Ive been wanting to build a simple(ish) app that helps onboard IoT devices (similar to thingspeak). I have an IoT sensor making POST requests to an express server, which is then passed to the client via a [login to view URL] emit() function. So I managed to make a profile and login system, via a user schema in mongodb, and for every user created, a 32-bit random string is generated in the DB which is meant to act as an API key. The idea is that the user can use the key as an API endpoint to receive data from the sensor. What I want to have happen in the application is once the user logs in, their API key is routed by the server, and they can use that key. I have managed to make the initial 'prototype', if you will. But this only works if I hard code a user's key into the [login to view URL]() function and in the [login to view URL]() request like so: ==================================================== [login to view URL]('/api/ZAH7Wu77AkW8valdhxMbdJhNQyO3bHEP') [login to view URL]("/api/ZAH7Wu77AkW8valdhxMbdJhNQyO3bHEP", function(request, response) { var myData = [login to view URL]; [login to view URL](myData) [login to view URL]('myData', myData); }); =================================================== So here are the requirements that I was hoping to get help with: 1. To pass the user's API key from the database into the API route dynamically (I think is the word?). I was hoping I could do something like this: [login to view URL]('/api/:apikey1) where apikey1 is the user's generated key. 2. You may notice in the code, I use [login to view URL] to emit the post request body (containing the data) to the client, but this gets broadcasted to every client. What Im now hoping to do is have it sent only to the client that has the private key. I have a 'profile' component set up (vue.js), and I was considering putting in logic on the application side to only display data if the private key is present, but I've come to learn that this may be very insecure and bad practice. I was hoping to hire somebody who has experience with MongoDB, Express and Node.js, and who knows how to route these private key values dynamically in the express server. Thank you for taking the time to read this, I'm a student from Boston MA, and I'm hoping to also learn how this type of thing is done. I look forward to hearing from you.
Projektin tunnus (ID): 25817276

Tietoa projektista

1 ehdotus
Etäprojekti
Aktiivinen 4 vuotta sitten

Haluatko ansaita rahaa?

Freelancerin tarjouskilpailun edut

Aseta budjettisi ja aikataulu
Saa maksu työstäsi
Kuvaile ehdotustasi
Rekisteröinti ja töihin tarjoaminen on ilmaista

Tietoja asiakkaasta

Maan UNITED STATES lippu
Deerfield, United States
5,0
1
Maksutapa vahvistettu
Liittynyt toukok. 30, 2020

Asiakkaan vahvistus

Kiitos! Olemme lähettäneet sinulle sähköpostitse linkin, jolla voit lunastaa ilmaisen krediittisi.
Jotain meni pieleen lähetettäessä sähköpostiasi. Yritä uudelleen.
Rekisteröitynyttä käyttäjää Ilmoitettua työtä yhteensä
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Ladataan esikatselua
Lupa myönnetty Geolocation.
Kirjautumisistuntosi on vanhentunut ja sinut on kirjattu ulos. Kirjaudu uudelleen sisään.