const options = {method: 'GET', headers: {Accept: 'application/json'}};
fetch('http://127.0.0.1:8000/api/readcp', options)
.then(response => response.json())
.then(response =>{
response.forEach(n => {
var N_array=n.longlat.split(",");
NMArker=L.marker(N_array,{icon:myIcon});
var popup=NMArker.bindPopup('This is' + n.address + 'point' + NMArker.getLatLng()).openPopup();
popup.addTo(map);
});
console.log(response)})
.catch(err => console.log(err));