Giter Club home page Giter Club logo

Comments (8)

Dassderdie avatar Dassderdie commented on September 23, 2024 1

Could you imaging doing this on the webserver level? So, e.g. nginx handles all requests. When it matches /api it gets redirected to port 3201 (HTTP server in the backend), where all other routes would be lead to 4200 (Angular). This would sound easier to me as we could deploy backend and frontend completely independent of each other, and plug them together using the webserver.

I don't see anything speaking against that.

from digital-fuesim-manv.

anonym-HPI avatar anonym-HPI commented on September 23, 2024

trying to get it into docker

from digital-fuesim-manv.

anonym-HPI avatar anonym-HPI commented on September 23, 2024

@ClFeSc what is your take about putting it into docker (at this stage)?

from digital-fuesim-manv.

ClFeSc avatar ClFeSc commented on September 23, 2024

I don't think it'd be a problem. We can just build everything and start it (from the dist, so not the watch modes) and expose the ports.

from digital-fuesim-manv.

Dassderdie avatar Dassderdie commented on September 23, 2024

During development, we are using angular's development server via ng serve. This server is not intended for production use.
Instead, the backend should:

  • prefix all API routes with e.g. /api
  • serve the build frontend files from the root path
  • redirect all unknown paths to the root path and serve the index.html (opening on /abc would return the frontend, the frontend deals with the path (and possibly display a 404 page itself))

Look here for more information. This question could be helpful too.

from digital-fuesim-manv.

anonym-HPI avatar anonym-HPI commented on September 23, 2024

#144

first beginning, using this guide: https://www.indellient.com/blog/how-to-dockerize-an-angular-application-with-nginx/

not tested, need to get my docker environment right

from digital-fuesim-manv.

ClFeSc avatar ClFeSc commented on September 23, 2024

During development, we are using angular's development server via ng serve. This server is not intended for production use. Instead, the backend should:

* prefix all API routes with e.g. `/api`

* serve the build frontend files from the root path

* redirect all unknown paths to the root path and serve the `index.html` (opening on `/abc` would return the frontend, the frontend deals with the path (and possibly display a 404 page itself))

Look here for more information. This question could be helpful too.

Could you imaging doing this on the webserver level? So, e.g. nginx handles all requests. When it matches /api it gets redirected to port 3201 (HTTP server in the backend), where all other routes would be lead to 4200 (Angular). This would sound easier to me as we could deploy backend and frontend completely independent of each other, and plug them together using the webserver.

from digital-fuesim-manv.

Dassderdie avatar Dassderdie commented on September 23, 2024
  • pass environment flags (whether production or not) to immer, socket.io, etc. (or make sure they use the Node environment)

from digital-fuesim-manv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.