- Current Figure: https://coronauk.isjeff.com/
- History: https://coronauk.isjeff.com/historyfigures
- Location center: https://coronauk.isjeff.com/locations
(Not Recommented for Front-End Use ↓)
4. History(with regional data): https://coronauk.isjeff.com/history
This sourcecode require very basic NodeJs skill, or just use the example API.
- install mysql database > create a 'corona' database > import 'sample.sql'
- rename
conf_tmp.js
toconf.js
, config mysql username and password - create config a mapbox API Token, or disable getLocation() and putLocation() in index.js. This is for getting geolocation center for map data, its kind of essential for doing data visualization.
- install lastest nodejs and run
npm i
npm run dev
or justnode index.js
- project will start at
http://localhost:8003
- Manually insert 2 row to
current
andcurrent_shadow
table, doesn't really matter what you filled in - you can find all router enterance point in index.js
-
Due to the announcement channel and structure might constantly changing, new data update will put into current_shadow table waiting for admin approve. Admin need to
GET
: http://HOST/approve?token= with token in the first row (id=1) of your user table, to update to official current table. -
Use
GET
: http://HOST/update?token= to manually update all data (you need to approve the new data as well) -
The false data may cause chaos to the public, please be careful.
-
As I am not a professional coder (I am a designer), I am welcome if anyone could help me make improvement. You can contact me through ISSUE page
-
If you are using this API, please be make sure data has cache and fault tolerance was considered. This is API is not completely reliable at all time.
Standard NodeJs + ExpressJs along with superagent, cheerio, axios, node-schedule. Detail is in: package.json. Admin page sourcecode are not available
If you are using this API, please join this discussion board. Keep updated for any significant changes!!
https://spectrum.chat/covid-19-uk-update
WeChat Group: