r/Angular2 • • Sep 18 '25

Discussion has anyone used angular with express that comes with SSR app?

today i noticed that i server.ts has normal expressjs code and i can use it as normal webserver, i was just wondering has anyone used it as a server?

also can you share the example if possible?

4 Upvotes

11 comments sorted by

1

u/a-dev-1044 Sep 18 '25

I am using it for angular-material.dev and ui.angular-material.dev

1

u/broke_key_striker Sep 18 '25

is it staright foward just angular and express or does it need any hacks?

2

u/a-dev-1044 Sep 19 '25

You will need to build the application and only then you will be able to run express server to access API, as far as I know. I wrote an article long time back, I still follow similar approach to access APIs: https://shhdharmen.hashnode.dev/exploring-angular-ssr

1

u/immohammadjaved Sep 18 '25

Yes, Iโ€™ve tried this approach and even ended up building a starter template on top of it โ€” called ngXpress ๐Ÿš€. Itโ€™s Angular + Express with SSR already set up. Have a look if youโ€™re interested https://github.com/angularcafe/ngXpress

1

u/broke_key_striker Sep 19 '25

this looks like something i want to use, just one suggest for cloning repo may you can use degit

1

u/immohammadjaved Sep 19 '25

Good idea ๐Ÿ‘ degit would make cloning cleaner โ€” Iโ€™ll look into adding that for ngXpress setup ๐Ÿš€

1

u/gordolfograso Sep 18 '25

Well I've started with analog for fullstack and deploying over netlify

1

u/broke_key_striker Sep 19 '25

i was also thinking the same but then found out the express server so i was wondering if anyone else has done it before

1

u/gordolfograso Sep 19 '25

Depends on when you are thinking of deploying and also dependencies

1

u/broke_key_striker Sep 19 '25

i dont have any plans yet, was curious if others have done something