You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cool. Here is my code for environment.ts, as a suggestion:
export const environment = {
production: false,
api: {
url: 'http://localhost:8585',
jpa: 'http://localhost:8585/jpa',
},
};
of course, the port for your setup will not stay 8585, so feel free to adapt it heavily ;-)
You basically use it in two places, basic-authentication.service and todo-data.service. In basic there is only one instance, in todo-data a couple, so I am just posting a few lines of todo-date as an example. In your version I sort of like that it uses all UPPERCASE because those are constants. This is not the way environment.ts is implemented, though, so you would have to live with lowercase:
import { environment } from 'src/environments/environment';
// This file can be replaced during build by using the fileReplacements array.
// ng build --prod replaces environment.ts with environment.prod.ts.
// The list of file replacements can be found in angular.json.
For easier debugging in development mode, you can import the following file
to ignore zone related error stack frames such as zone.run, zoneDelegate.invokeTask.
This import should be commented out in production mode because it will have a negative impact
on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
Lemme know if I can be of more help. Note that I have the tomcat configured to run on 8585 because 8080 is used by my local Jira.
cool. Here is my code for environment.ts, as a suggestion:
export const environment = {
production: false,
api: {
url: 'http://localhost:8585',
jpa: 'http://localhost:8585/jpa',
},
};
of course, the port for your setup will not stay 8585, so feel free to adapt it heavily ;-)
You basically use it in two places, basic-authentication.service and todo-data.service. In basic there is only one instance, in todo-data a couple, so I am just posting a few lines of todo-date as an example. In your version I sort of like that it uses all UPPERCASE because those are constants. This is not the way environment.ts is implemented, though, so you would have to live with lowercase:
import { environment } from 'src/environments/environment';
...
export class TodoDataService {
...
retrieveAllTodos(username) {
return this.http.get<Todo[]>(
${environment.api.jpa}/users/${username}/todos
);...
}
...
}
The text was updated successfully, but these errors were encountered: