| | |
| | |
| | |
| | |
| |
|
| | const express = require('express'); |
| | const upscaleFeature = require('./features/upscale.js'); |
| | const imageDescribeFeature = require('./features/image-describe.js'); |
| | const ghibliRemixFeature = require('./features/ghibli-remix.js'); |
| |
|
| | const app = express(); |
| | const port = process.env.PORT || 7860; |
| |
|
| | app.use(express.json({ limit: '10mb' })); |
| | app.use(express.urlencoded({ extended: true, limit: '10mb' })); |
| |
|
| | app.get('/', (req, res) => { |
| | res.status(200).json({ status: 'ok', message: 'Worker server is running.' }); |
| | }); |
| |
|
| | app.post('/upscale', upscaleFeature); |
| | app.post('/image-describe', imageDescribeFeature); |
| | app.post('/ghibli-remix', ghibliRemixFeature); |
| |
|
| | app.listen(port, () => { |
| | console.log(`Worker server listening on port ${port}`); |
| | }); |