Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

174
Vistas
How to connect React Front end to Node backend with tls/https

I created a server that is set up with https below sample:

const express = require("express");
const fs = require("fs");
const https = require("https");

const app = express();
const port = process.env.PORT || 8000;

var options = {
    key: fs.readFileSync("server.key"),
    cert: fs.readFileSync("server.cert"),
};


app.listen(port);
https.createServer(options, app).listen(8080, function () {
    console.log(
        "Example app listening on port 8080! Go to https://localhost:8080/"
    );
});

this works fine, but I am not sure how to configure React to make proper handshake. I want to secure both as I want to be able to send files from front to back end securely. I tried setting script in package.json to

"start": "set HTTPS=true&&set SSL_CRT_FILE=server.cert&&set SSL_KEY_FILE=server.key&&react-scripts start"

where I copied .cert and .key that I generated for backend. But as I understood I need to set up different ones locally. https://medium.com/@danielgwilson/https-and-create-react-app-3a30ed31c904 I probably misunderstood something about TLS/HTTPS

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda