Skip to content

Commit

Permalink
Changed AI Image generation model
Browse files Browse the repository at this point in the history
  • Loading branch information
GIT-Gizmo committed Sep 20, 2024
1 parent 526b037 commit b6b08a7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions server/routes/ai.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ import axios from "axios";
const router = express.Router();

router.route("/").get((req, res) => {
res.status(200).json({ message: "Hello from DALL.E Routes"});
res.status(200).json({ message: "Hello from AI-Stitches" });
})

router.post("/", async (req, res) => {
const { prompt } = req.body;
const apiKey = process.env.RAPID_API_KEY;

const options = {
method: 'POST',
url: 'https://imageai-generator.p.rapidapi.com/image',
headers: {
'content-type': 'application/json',
'X-RapidAPI-Key': process.env.RAPID_API_KEY,
'X-RapidAPI-Host': 'imageai-generator.p.rapidapi.com'
'x-rapidapi-key': apiKey,
'x-rapidapi-host': 'imageai-generator.p.rapidapi.com',
'Content-Type': 'application/json'
},
data: {
prompt: prompt,
Expand Down

0 comments on commit b6b08a7

Please sign in to comment.