Spaces:
Build error
Build error
Update api.js
Browse files
api.js
CHANGED
|
@@ -15,7 +15,7 @@ app.use(cors()); // Enable CORS for all routes
|
|
| 15 |
require('dotenv').config()
|
| 16 |
|
| 17 |
|
| 18 |
-
const MEDIA_FOLDER =
|
| 19 |
const OPENAI_API_KEY = process.env.OPENAI_API_KEY
|
| 20 |
|
| 21 |
// Ensure the MEDIA_FOLDER directory exists
|
|
@@ -274,7 +274,7 @@ app.post("/generate/image", async(req, res)=> {
|
|
| 274 |
|
| 275 |
|
| 276 |
// Client webpages and storage for generated content
|
| 277 |
-
app.use('/', express.static(
|
| 278 |
|
| 279 |
const port = 7860;
|
| 280 |
app.listen(port, () => {
|
|
|
|
| 15 |
require('dotenv').config()
|
| 16 |
|
| 17 |
|
| 18 |
+
const MEDIA_FOLDER = `public/media`
|
| 19 |
const OPENAI_API_KEY = process.env.OPENAI_API_KEY
|
| 20 |
|
| 21 |
// Ensure the MEDIA_FOLDER directory exists
|
|
|
|
| 274 |
|
| 275 |
|
| 276 |
// Client webpages and storage for generated content
|
| 277 |
+
app.use('/', express.static("public"));
|
| 278 |
|
| 279 |
const port = 7860;
|
| 280 |
app.listen(port, () => {
|