Skip to content

Fast and easy food delivery from the best restaurants near you. Location City of Novi Sad.

Notifications You must be signed in to change notification settings

nteske/Eatin-Frontend

Repository files navigation

Eatin Frontend

This project was generated with Angular CLI version 9.1.4.

Development server

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.

Token

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

Routes for Backend

Backend url is set to http://localhost:7000, file:api-urls.ts.

1.Auth

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"
      }

2.Restaurant

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
            },
            {
            ....
            }
      ]