Answer the question
In order to leave comments, you need to log in
How to get data from the database and generate JSON?
I apologize in advance for the confusion.
How the site works in my head:
the site goes down -> makes a request to the server -> the server returns a JSON file -> javascript works with this JSON and populates the site with certain data.
(through this JSON file, markers on the leaflet map will be drawn)
It is necessary that data be entered through the admin part, and then, through a database request, give a JSON file.
What is the best and easiest way to achieve what you want?
upd:
An example of JSON that the site should receive.
[
{
"endPlace": [425, 330],
"icon": "endIcon30",
"startPlace": [
{
"startPoint": [45, 875],
"icon": "startIcon20",
"url": ["[email protected]", "3mcWTjoi2zFE"]
}
]
},
{
"endPlace": [452, 175],
"icon": "endIcon30",
"startPlace": [
{
"startPoint": [936, 845],
"icon": "startIcon20",
"url": ["[email protected]", "[email protected]"]
}
]
},
{
"endPlace": [10, 10],
"icon": "endIcon30",
"startPlace": [
{
"startPoint": [54, 845],
"icon": "startIcon20",
"url": ["_aC5423TjUU", "3mcWT345zFE"]
}
]
}
]
Answer the question
In order to leave comments, you need to log in
make select
the results of this select convert to jison
on the client fill something based on this data
If something is missing, then repeat the steps
A straight forward question.
- Why not store this data directly in json on the back?
Or are there too many of them?
If there are hundreds and thousands of records, then why bother with the database?
I read the json file into the dictionary, found what I needed with a simple search and gave it to the front.
Not?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question