-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjsonapi.js
20 lines (17 loc) · 825 Bytes
/
jsonapi.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//create javascript array with name of link + URL
export const linkArray = {
nevikaLinks: [
{"name": "Check Out my Upcycled Art Portfolio", "url": "https://www.instagram.com/madebynev/" },{ "name": "Learn More about the Sustainable Fashion Revolution", "url": "https://www.fashionrevolution.org/about/" },{ "name": "Shop Ethical and Eco-Friendly Retail Brands", "url": "https://goodonyou.eco/" }
]
}
//return json from workers cript
export default async function () {
//documentation taken from 'return JSON' examples doc
const jsonArray = JSON.stringify(linkArray, null)
return new Response(jsonArray, {
//change content type header (to indicate to clients that it is a JSON response)
headers: {
"content-type": "application/json; charset=UTF-8"
}
})
}