Angular + HTTPS NodeJS

kevinuzan
HOBBY

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
HOBBY

a year ago

NA


a year ago

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


a year ago

do you already have a backend up and running?


kevinuzan
HOBBY

a year ago

I have a sample project actually, nothing too big


kevinuzan
HOBBY

a year ago

c79bd679-e479-4c34-b56d-1acc8c93dfc0


kevinuzan
HOBBY

a year ago

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


kevinuzan
HOBBY

a year ago

Or I can start from zero as well


a year ago

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


kevinuzan
HOBBY

a year ago

Yeah


kevinuzan
HOBBY

a year ago

I could start from zero


kevinuzan
HOBBY

a year ago

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

1254140667915932000


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
HOBBY

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?


a year ago

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


a year ago

angular is purely the frontend


a year ago

show me your project now please


kevinuzan
HOBBY

a year ago

1254143547205222400


a year ago

perfect, start programming


kevinuzan
HOBBY

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


a year ago

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


kevinuzan
HOBBY

a year ago

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


kevinuzan
HOBBY

a year ago

Like


kevinuzan
HOBBY

a year ago

1254145153799815400


kevinuzan
HOBBY

a year ago

Just those stuff?

1254145227745132500


kevinuzan
HOBBY

a year ago

And railway will automatically link them?


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
HOBBY

a year ago

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


a year ago

^


a year ago

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


kevinuzan
HOBBY

a year ago

Alright


kevinuzan
HOBBY

a year ago

Thanks for your help, that was a lot already


kevinuzan
HOBBY

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
HOBBY

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
HOBBY

a year ago

This is my package.json


kevinuzan
HOBBY

a year ago


kevinuzan
HOBBY

a year ago

@Brody


Angular + HTTPS NodeJS - Railway Help Station