Spaces:
Sleeping
Sleeping
FROM node:18-alpine | |
WORKDIR /app | |
# Create minimal package.json | |
RUN echo '{"name":"cursor-api","version":"1.0.0","main":"index.js","dependencies":{"express":"^4.18.2"}}' > package.json | |
# Install dependencies | |
RUN npm install | |
# Create a simple API server | |
RUN echo 'const express = require("express"); \ | |
const app = express(); \ | |
const port = process.env.PORT || 7860; \ | |
\ | |
app.get("/", (req, res) => { \ | |
res.json({ status: "Cursor API running", auth: process.env.AUTH_TOKEN }); \ | |
}); \ | |
\ | |
app.listen(port, "0.0.0.0", () => { \ | |
console.log(`Cursor API listening on port ${port}`); \ | |
});' > index.js | |
# HF Spaces uses port 7860 by default | |
ENV PORT=7860 | |
# Expose the port (HF Spaces uses 7860) | |
EXPOSE 7860 | |
# Start the application | |
CMD ["node", "index.js"] |