Angular + HTTPS NodeJS
kevinuzan
HOBBYOP

a year ago

Hello, I have a deployment where I have my server running, but I would like to implement angular, could someone help me out on how to run a backend server to "talk" to my angular project?

0 Replies

kevinuzan
HOBBYOP

a year ago

NA


brody
EMPLOYEE

a year ago

other way around, the angular frontend will "talk" to the backend


brody
EMPLOYEE

a year ago

do you already have a backend up and running?


kevinuzan
HOBBYOP

a year ago

I have a sample project actually, nothing too big


kevinuzan
HOBBYOP

a year ago

c79bd679-e479-4c34-b56d-1acc8c93dfc0


kevinuzan
HOBBYOP

a year ago

I have the HTTP NodeJS running, and I would like to implement angular


kevinuzan
HOBBYOP

a year ago

Or I can start from zero as well


brody
EMPLOYEE

a year ago

does that mean you don't currently have any angular code written


kevinuzan
HOBBYOP

a year ago

Yeah


kevinuzan
HOBBYOP

a year ago

I could start from zero


kevinuzan
HOBBYOP

a year ago

That's all I have, only the structure with MongoDB

1254140667915932000


brody
EMPLOYEE

a year ago

go here and enable "template service eject"
open your project and deploy the "angular 18 static" template
open the service settings of the deployed service and eject it
clone that ejected repo and start coding


kevinuzan
HOBBYOP

a year ago

Okay, done! Now the repository is on my github, so now, I can add MongoDB to the Angular Server? And should I delete the http-nodejs from my project?


brody
EMPLOYEE

a year ago

no, angular has nothing to do with mongo or your http nodejs server


brody
EMPLOYEE

a year ago

angular is purely the frontend


brody
EMPLOYEE

a year ago

show me your project now please


kevinuzan
HOBBYOP

a year ago

1254143547205222400


brody
EMPLOYEE

a year ago

perfect, start programming


kevinuzan
HOBBYOP

a year ago

Thanks, sorry to ask too many questions, but how do I "link" the angular with my backend "server.mjs"?
This is my server.mjs inside the "http-nodejs"
How do I make an app.get/app.post from my angular to my server

1254144243639914500


brody
EMPLOYEE

a year ago

are you familiar with the fetch API? you use that in your angular app to call endpoints on the backend


kevinuzan
HOBBYOP

a year ago

I just have to do the same I was doing on my http-nodejs HTML and JS?


kevinuzan
HOBBYOP

a year ago

Like


kevinuzan
HOBBYOP

a year ago

1254145153799815400


kevinuzan
HOBBYOP

a year ago

Just those stuff?

1254145227745132500


kevinuzan
HOBBYOP

a year ago

And railway will automatically link them?


brody
EMPLOYEE

a year ago

I'm not sure where this linking is coming from, you need to write code to call your backend's domain, at this point it's all your code, not much to do with railway anymore


kevinuzan
HOBBYOP

a year ago

I think that's exactly the point that I don't know how to do… How to call my backend domain


brody
EMPLOYEE

a year ago

^


brody
EMPLOYEE

a year ago

please watch some YouTube videos because we aren't able to provide coding help, only platform help


kevinuzan
HOBBYOP

a year ago

Alright


kevinuzan
HOBBYOP

a year ago

Thanks for your help, that was a lot already


kevinuzan
HOBBYOP

a year ago

I have managed to make it work locally! Thanks for your help, but now, I'm trying to deploy it on railway but I have an error message now: "/bin/bash -ol pipefail -c npm run build"


kevinuzan
HOBBYOP

a year ago

{
  "name": "my-app",
  "version": "0.0.0",
  "scripts": {
    "dev": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^18.0.0",
    "@angular/common": "^18.0.0",
    "@angular/compiler": "^18.0.0",
    "@angular/core": "^18.0.0",
    "@angular/forms": "^18.0.0",
    "@angular/platform-browser": "^18.0.0",
    "@angular/platform-browser-dynamic": "^18.0.0",
    "@angular/router": "^18.0.0",
    "bulma": "^1.0.1",
    "process": "^0.11.10",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.14.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^18.0.3",
    "@angular/cli": "^18.0.3",
    "@angular/compiler-cli": "^18.0.0",
    "@types/jasmine": "~5.1.0",
    "jasmine-core": "~5.1.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "typescript": "~5.4.2"
  }
}

kevinuzan
HOBBYOP

a year ago

This is my package.json


kevinuzan
HOBBYOP

a year ago


kevinuzan
HOBBYOP

a year ago

@Brody


Loading...