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
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?
a year ago
does that mean you don't currently have any angular code written
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
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
a year ago
perfect, start programming
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
a year ago
are you familiar with the fetch API? you use that in your angular app to call endpoints on the backend
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
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
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"
{
"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"
}
}