Skip to content

Commit

Permalink
index host 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunjin1109 committed Jun 8, 2024
1 parent a038712 commit 9f4aef3
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions my-replicate-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import path from "path";
dotenv.config();

const REPLICATE_API_TOKEN = process.env.REPLICATE_API_TOKEN;
const JWT2 = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySW5mb3JtYXRpb24iOnsiaWQiOiI3NWQxNDhiNS1kMzQ5LTRlZmUtYTcwYy04YjA2NmIwYWVlYjciLCJlbWFpbCI6InJ5bHlubjEwMjlAbmF2ZXIuY29tIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsInBpbl9wb2xpY3kiOnsicmVnaW9ucyI6W3siaWQiOiJGUkExIiwiZGVzaXJlZFJlcGxpY2F0aW9uQ291bnQiOjF9LHsiaWQiOiJOWUMxIiwiZGVzaXJlZFJlcGxpY2F0aW9uQ291bnQiOjF9XSwidmVyc2lvbiI6MX0sIm1mYV9lbmFibGVkIjpmYWxzZSwic3RhdHVzIjoiQUNUSVZFIn0sImF1dGhlbnRpY2F0aW9uVHlwZSI6InNjb3BlZEtleSIsInNjb3BlZEtleUtleSI6IjFlNjIwM2Q0NjIzY2I3ZTBlODFkIiwic2NvcGVkS2V5U2VjcmV0IjoiZjczNDVlNDIxZjkzNjNkNjJiYzU3ZWQ5ZTBlY2Y5NzQ5YzEzMjRhM2Q1YjE1ZmQwY2U4MTk4ZDU5ZTBmM2NiMSIsImlhdCI6MTcxMTA4Mzg5M30.ofdRllbxJO2Qk0-co3FXaPpou6EBRqE9gImfu6iR06Q"; // Replace with your actual JWT token
const JWT2 =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySW5mb3JtYXRpb24iOnsiaWQiOiI3NWQxNDhiNS1kMzQ5LTRlZmUtYTcwYy04YjA2NmIwYWVlYjciLCJlbWFpbCI6InJ5bHlubjEwMjlAbmF2ZXIuY29tIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsInBpbl9wb2xpY3kiOnsicmVnaW9ucyI6W3siaWQiOiJGUkExIiwiZGVzaXJlZFJlcGxpY2F0aW9uQ291bnQiOjF9LHsiaWQiOiJOWUMxIiwiZGVzaXJlZFJlcGxpY2F0aW9uQ291bnQiOjF9XSwidmVyc2lvbiI6MX0sIm1mYV9lbmFibGVkIjpmYWxzZSwic3RhdHVzIjoiQUNUSVZFIn0sImF1dGhlbnRpY2F0aW9uVHlwZSI6InNjb3BlZEtleSIsInNjb3BlZEtleUtleSI6IjFlNjIwM2Q0NjIzY2I3ZTBlODFkIiwic2NvcGVkS2V5U2VjcmV0IjoiZjczNDVlNDIxZjkzNjNkNjJiYzU3ZWQ5ZTBlY2Y5NzQ5YzEzMjRhM2Q1YjE1ZmQwY2U4MTk4ZDU5ZTBmM2NiMSIsImlhdCI6MTcxMTA4Mzg5M30.ofdRllbxJO2Qk0-co3FXaPpou6EBRqE9gImfu6iR06Q"; // Replace with your actual JWT token

const PORT = process.env.PORT || 5002;
const pipeline = promisify(stream.pipeline);
Expand All @@ -28,17 +29,20 @@ app.use(bodyParser.json());

app.use(
cors({
origin: ['http://localhost:3000', 'http://localhost:8888', 'https://spirographmaker.netlify.app'],
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
origin: [
"http://localhost:3000",
"http://localhost:8888",
"https://spirographmaker.netlify.app",
],
methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
credentials: true,
allowedHeaders: 'Content-Type, Authorization',
allowedHeaders: "Content-Type, Authorization",
})
);

const urlStatus = {};

async function pinFileToIPFS(filePath) {

const proxyUrl = "https://frozen-scrubland-19711-6243810201c8.herokuapp.com/";
const targetUrl = "https://api.pinata.cloud/pinning/pinFileToIPFS";
const url = `${proxyUrl}${targetUrl}`;
Expand All @@ -63,7 +67,6 @@ async function pinFileToIPFS(filePath) {
}

const pinJSONToIPFS = async (json) => {

const proxyUrl = "https://frozen-scrubland-19711-6243810201c8.herokuapp.com/";
const targetUrl = "https://api.pinata.cloud/pinning/pinFileToIPFS";
const url = `${proxyUrl}${targetUrl}`;
Expand Down Expand Up @@ -98,7 +101,8 @@ async function runReplicateModel(url, prompt) {
auth: REPLICATE_API_TOKEN,
});

const model = "stability-ai/sdxl:39ed52f2a78e934b3ba6e2a89f5b1c712de7dfea535525255b1aa35c5565e08b";
const model =
"stability-ai/sdxl:39ed52f2a78e934b3ba6e2a89f5b1c712de7dfea535525255b1aa35c5565e08b";
const input = {
width: 768,
height: 768,
Expand Down Expand Up @@ -234,6 +238,6 @@ app.get("/check-status", (req, res) => {
res.json(statusInfo);
});

app.listen(PORT, host, () => {
app.listen(PORT, () => {
console.log(`Server running at http://localhost:${PORT}`);
});

0 comments on commit 9f4aef3

Please sign in to comment.