Angular + HTTPS NodeJS
kevinuzan
HOBBYOP

2 years 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?

36 Replies

kevinuzan
HOBBYOP

2 years ago

NA


2 years ago

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


2 years ago

do you already have a backend up and running?


kevinuzan
HOBBYOP

2 years ago

I have a sample project actually, nothing too big


kevinuzan
HOBBYOP

2 years ago

c79bd679-e479-4c34-b56d-1acc8c93dfc0


kevinuzan
HOBBYOP

2 years ago

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


kevinuzan
HOBBYOP

2 years ago

Or I can start from zero as well


2 years ago

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


kevinuzan
HOBBYOP

2 years ago

Yeah


kevinuzan
HOBBYOP

2 years ago

I could start from zero


kevinuzan
HOBBYOP

2 years ago

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

1254140667915932000


2 years 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

2 years 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?


2 years ago

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


2 years ago

angular is purely the frontend


2 years ago

show me your project now please


kevinuzan
HOBBYOP

2 years ago

1254143547205222400


2 years ago

perfect, start programming


kevinuzan
HOBBYOP

2 years 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


2 years ago

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


kevinuzan
HOBBYOP

2 years ago

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


kevinuzan
HOBBYOP

2 years ago

Like


kevinuzan
HOBBYOP

2 years ago

1254145153799815400


kevinuzan
HOBBYOP

2 years ago

Just those stuff?

1254145227745132500


kevinuzan
HOBBYOP

2 years ago

And railway will automatically link them?


2 years 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

2 years ago

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


2 years ago

^


2 years ago

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


kevinuzan
HOBBYOP

2 years ago

Alright


kevinuzan
HOBBYOP

2 years ago

Thanks for your help, that was a lot already


kevinuzan
HOBBYOP

2 years 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

2 years 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

2 years ago

This is my package.json


kevinuzan
HOBBYOP

2 years ago


kevinuzan
HOBBYOP

2 years ago

@Brody


Loading...