mardi 7 novembre 2017

Flask url route tracing

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 in the whole project.




Aucun commentaire:

Enregistrer un commentaire