Skip to content

Commit 22fb065

Browse files
move stuff to env
1 parent d1d39f8 commit 22fb065

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pages/api/josh.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import axios from 'axios';
22
import type { NextApiRequest, NextApiResponse } from 'next'
3+
require('dotenv').config()
34

45
type ResponseData = {
56
message: string
@@ -13,7 +14,7 @@ export default function handler(
1314
const { subject } = query;
1415

1516
// make request to josh's crappy go server
16-
axios.get(`http://82.165.5.190:8888/short_fact/${subject || "gecko"}`).then((response) => {
17+
axios.get(`${process.env.JOSH_API}/short_fact/${subject || "gecko"}`).then((response) => {
1718
res.status(200).json({ message: response.data });
1819
}).catch((err) => {
1920
res.status(500).json({ message: `Error querying Josh's API (skill issue): ${err}` });

0 commit comments

Comments
 (0)