mirror of
https://github.com/kremalicious/portfolio.git
synced 2024-11-15 01:25:25 +01:00
Matthias Kretschmann
5a310017b9
* add current and next location * add documentation * api -> src/api symlink so local dev & Vercel work * add to footer * test changes * styling changes * spacing * layout fixes
16 lines
411 B
JavaScript
16 lines
411 B
JavaScript
import axios from 'axios'
|
|
|
|
export default async function getLocationHandler(req, res) {
|
|
if (!process.env.NOMADLIST_PROFILE) return
|
|
|
|
try {
|
|
const response = await axios(
|
|
`https://nomadlist.com/@${process.env.NOMADLIST_PROFILE}.json?key=${process.env.NOMADLIST_KEY}`
|
|
)
|
|
if (!response?.data) return
|
|
res.json(response.data.location)
|
|
} catch (error) {
|
|
res.status(500).send(error)
|
|
}
|
|
}
|