A template for creating a read-only API from a CSV file and hosting it on GitHub Pages
- Create a copy of this repo template.
- Replace
mydata.csv
with your data. - Publish to GitHub Pages.
Your data is published as a JSON file that you can use to pull content into your apps and design tools.
- On the code tab, press the
Use this template
button. - You will be prompted to create a new repository under your account.
- IMPORTANT: Use the same repo name,
nocode-api-github-pages
, so that everything works out of the box. If you want to use a different name, you can, you just need to update thebaseurl
setting in the_config.yml
to match.
- The
mydata.csv
file is located in the_data
folder. - This file contains example data you can test with your repo.
- To replace the data, you can copy and paste text comma-separated-value format over the existing text or you can replace the whole file.
- To keep things simple, name your file “mydata.csv” and replace the existing one.
- If you want to use a different filename, update the
data-file-name
setting in the_config.yml
file. (Note: Don't include the.csv
extension in the setting; just the filename.)
To see what's going on with your data, you can use json2table.com to see the JSON content rendered as both a table and tree. Just copy and paste the content from your
api.json
file. This can help with troubleshooting if something is not working.Note this site is not secure so don't paste any sensitive data there.
- Under the Settings, go to Pages.
- Set the source to
main
and pressSave
. - After a few minutes your site will be live at the displayed URL.
- The homepage will show the basic information about this tool.
- The URL of the JSON file is
http://YOUR-GITHUB-ACCOUNT/YOUR-REPO-NAME/api.json
.
This project was created primarily using the GitHub Pages gem for Jekyll and a slightly modified HTML5 Boilerplate.