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

295
Vistas
What's the correct configuration of main in angular-cli.json to use express?

I'm trying to configure a express server using Angular 2, in many configuration examples I saw the angular-cli.json being changed in the main configuration pointing to a server.js file.

But when I change it, the application doesn't start on ng serve.

I would have to call the main.ts file inside of the server.js? How?

Ex:

"main": "main.ts"
"main": "server.ts"

My express server is very simple, I used as base the following: https://tableless.com.br/criando-uma-aplicacao-de-chat-simples-com-nodejs-e-socket-io/

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

To reiterate from above, you are just going to build your project using the proxy for local development following the - cli proxy docs.

If you do something like

ng serve --host 0.0.0.0 --proxy-config proxy.conf.json

with your proxy.conf.json

{
  "/api": {
  "target": "http://localhost:3000",
  "secure": false
  }
}

For express as your server you will send a route back to the dist/index file with something like -

app.all('/*', function(req, res) {
    res.sendFile( DIST +'/index.html');
});
about 4 years ago · Santiago Trujillo Denunciar
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