How Can I Setting Up HTTPS for using a Web API
I'm currently working on a project that involves setting up HTTPS for a web API, and I've run into a few challenges along the way.
My project centers around webcam functionality. To ensure that the web API is accessible via HTTPS, I attempted to use tools like
browser-sync
and http-server
to facilitate HTTPS serving during local development. Regrettably, these tools did not function as anticipated.
For instance, in the case of browser-sync
, I adhered to the provided documentation and followed these steps:
Subsequently, I incorporated the script into my HTML file. However, upon accessing the localhost link, the browser displayed the browser-sync configuration page instead of my project, as evidenced in the screenshot.
I would be tremendously appreciative if someone could offer guidance or share their insights regarding the process of establishing HTTPS for a web API.5 Replies
maybe this will help?
You sure you have to?
yes and no, This project is for learning purposes but making the webcam work locally according to MDN HTTPS is required, see : https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
MediaDevices: getUserMedia() method - Web APIs | MDN
The MediaDevices.getUserMedia() method prompts the user for permission to use a media input which produces a MediaStream with tracks containing the requested types of media.