vendredi 31 juillet 2015

Express.js route and regex

I have an object like this :

geo: {
        description: 'Geolocalisation',
        properties: {
            latitude: {type: 'number'},
            longitude: {type: 'number'}
        }
    }

I want to create routes to retrive a nested object like :

host/geo.schema or host/geo.json

to get the entire object

host/geo/properties.schema or host/geo/properties.json

to get

properties: {
            latitude: {type: 'number'},
            longitude: {type: 'number'}
        }

Aucun commentaire:

Enregistrer un commentaire