I have a following front-end code in js(/ember/create/app/components/someFile.js):
component.$('.city-select-autocomplete').marcoPolo({
url: '/api/objects/cities',
data: {range_size: 8, order_by: '-population'},
minChars: 3,
required: true,
param: 'search',
formatData: function (data) {
return data.cities.sortBy('population').reverse();
},
formatItem: function (data, $item) {
var state = data.country_code === 'US' ? data.admin1_code + ', ' : '';
return data.name + ', ' + state + data.country_code;
},
I am trying to find out where the implementation(server code) is written for url "/api/objects/cities". I tried searching URL mappings but couldn't find it.
Project structure:
config/
controllers/
deploy/
docs/
ember/
env/
models/
static/
tasks/
templates/
tests/
tools/
utils/
vacuum/
web/
serve.py
..
..
..
There must be some url mapping with ("/api/objects/cities") using @app.route annotation but I wasn't able to find it.
There must be some convention. api/objects is constant but the last part obj_type varies so there must be a method with the name "cities" and it might be matching by method name. /api/objects/ maps to method with name ? Right ? But I am not finding any such method in controller/web folder.
Aucun commentaire:
Enregistrer un commentaire