30 lines
930 B
Python
30 lines
930 B
Python
# encoding: utf-8
|
|
|
|
from app import admin
|
|
from app.controller.admin import admin_routes
|
|
from app.controller.api.country import CountriesApi, CountryApi
|
|
from app.controller.api.representative import RepresentativesApi, RepresentativeApi
|
|
from app.controller.core import Core
|
|
from app.controller.representative import Representative
|
|
|
|
|
|
# Adding admin endpoints
|
|
for route in admin_routes:
|
|
admin.add_view(route[0](name=route[1], endpoint=route[2], category=route[3]))
|
|
|
|
# Listing normal endpoints
|
|
routes = [
|
|
("/", Core.as_view("home")),
|
|
("/representative/<int:representative_id>", Representative.as_view("view")),
|
|
("/about", Core.as_view("about")),
|
|
("/who", Core.as_view("who")),
|
|
]
|
|
|
|
# Listing API endpoints
|
|
apis = [
|
|
('/api/country', CountriesApi),
|
|
('/api/country/<country_id>', CountryApi),
|
|
('/api/representative', RepresentativesApi),
|
|
('/api/representative/<representative_id>', RepresentativeApi),
|
|
]
|