This project was generated with Angular CLI version 9.1.4.
On first start run npm i
. Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties.
Payload
{
...
"role":"Admin",
...
}
Roles, file: roles.ts
Backend url is set to http://localhost:7000
, file:api-urls.ts.
Value is set to /auth/
, file:api-urls.ts.
Login is set to login
.
Register is set to register
.
Login route:
Post: http://localhost:7000
+/auth/
+login
Data sent:
{
"username":"test",
"password":"text"
}
Data received:
{
"jwt":"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJpdm....."
}
Register route:
Post: http://localhost:7000
+/auth/
+register
Data sent:
{
"emailKorisnika":"test",
"imeKorisnika":"text"
"lozinkaKorisnika":"test",
"prezimeKorisnika":"test",
"telefonKorisnika":"test"
}
Value is set to /restaurant/
, file:api-urls.ts.
Locations of all restaurants, route is set to locations
.
Locations of all restaurants - route:
Get: http://localhost:7000
+/restaurant/
+locations
Data received:
[
{
"id_lokacije":1,
"grad":"Novi Sad",
"ulica":"Bulevar Oslobodjenja",
"broj":"bb",
"postanski_broj":"21000",
"longitude":19.0,
"latitude":45.0
},
{
....
}
]