endpoint added

This commit is contained in:
ed barz 2022-05-16 23:28:39 +02:00
parent 3a44654e01
commit 18d57fc33a
6 changed files with 97 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,3 +1,7 @@
const dburl = "http://localhost:3000/db"
//const dburl = "https://ed.brz9.dev/proj/map/asset/json/db.json"
Vue.component('Accordeon', { Vue.component('Accordeon', {
template : ` template : `
<section v-bind:id="this.list.id"> <section v-bind:id="this.list.id">
@ -81,7 +85,6 @@ let vm = new Vue({
data: { data: {
currentLang: 'fr', currentLang: 'fr',
fdata: {}, fdata: {},
dburl : "https://ed.brz9.dev/proj/map/asset/json/db.json",
db : {}, db : {},
db2 : { db2 : {
restaurants : { restaurants : {
@ -183,7 +186,7 @@ let vm = new Vue({
} }
}, },
async getJDB(){ async getJDB(){
const res = await fetch(this.dburl); const res = await fetch(dburl);
const data = await res.json(); const data = await res.json();
this.db = data; this.db = data;
}, },
@ -198,7 +201,7 @@ let vm = new Vue({
created: function(){ created: function(){
console.log("about to call getJDB") console.log("about to call getJDB")
// this.getJDB(); // this.getJDB();
fetch("http://localhost:3000/db") fetch(dburl)
.then(res => res.json()) .then(res => res.json())
.then(data => this.db = data) .then(data => this.db = data)
.catch(err => console.log(err.message)) .catch(err => console.log(err.message))

Binary file not shown.

View File

@ -0,0 +1,90 @@
<?php
header('Content-type: application/json')
echo '
{
"db" : {
"restaurants" : {
"id" : "resto",
"type" : "list",
"nameFR" : "Restaurant",
"nameEN" : "Restaurant",
"nameIT" : "Ristoranti",
"sub" : {
"italiens" : {
"id": "restoital",
"type" : "list",
"nameFR" : "Italien",
"nameEN" : "Italian",
"nameIT" : "Italiano",
"sub" : {
"SanTelmo" : {
"id": "santelmo",
"type" : "item",
"name": "Sant Elmo",
"img": "https://ed.brz9.dev/proj/map/asset/img/santelmo.jpg",
"txtFR": "Français Adipisicing live-edge fam velit. Messenger bag poke laboris aesthetic viral do semiotics authentic est selfies.",
"txtEN": "English Adipisicing live-edge fam velit. Messenger bag poke laboris aesthetic viral do semiotics authentic est selfies.",
"txtIT": "Italiano Adipisicing live-edge fam velit. Messenger bag poke laboris aesthetic viral do semiotics authentic est selfies.",
"card" : {
"tabs" : {
"menu" : {
"priceRange" : "18-32€",
"dishes" : {
"divola" : {
"name" : "Pizza Divola"
},
"regina" : {
"name" : "Pizza Regina"
}
}
},
"time" : {
"monAM" : "11h30-14h00",
"monPM" : "18h30-22h00"
}
}
}
},
"Salsamenteria" : {
"id" : "salsamenteria",
"type" : "item",
"name" : "Salsamenteria di Parma",
"img" : "https://ed.brz9.dev/proj/map/asset/img/salsamentiera.jpg",
"txtFR" : "Français Adipisicing live-edge fam velit. Messenger bag poke laboris aesthetic viral do semiotics authentic est selfies.",
"txtEN" : "English Adipisicing live-edge fam velit. Messenger bag poke laboris aesthetic viral do semiotics authentic est selfies.",
"txtIT" : "Italiano Adipisicing live-edge fam velit. Messenger bag poke laboris aesthetic viral do semiotics authentic est selfies."
}
}
},
"vege" : {
"id" : "restovege",
"type" : "list",
"nameFR" : "Végétarien",
"nameEN" : "Vegan",
"nameIT" : "Vegetariano",
"sub" : {
"SanTelmo" : {
"id": "santelmo",
"type" : "item",
"name": "San Telmo"
},
"Salsamenteria" : {
"id": "salsamenteria",
"type" : "item",
"name" : "Salsamenteria di Parma"
}
}
}
}
}
}
}
';
?>

View File

@ -42,9 +42,8 @@
</body> </body>
<script src="asset/js/vue.min.js"></script> <script src="asset/js/vue.min.js"></script>
<script src="asset/leaflet/leaflet.js"></script> <script src="asset/leaflet/leaflet.js"></script>
<script src="./asset/vu-leaflet/node_modules/vue2-leaflet"></script>
<script src="asset/js/main.js"></script>
<script src="asset/js/main.js"></script>
<script src="asset/js/map.js"></script> <script src="asset/js/map.js"></script>
</html> </html>