File size: 775 Bytes
e397c42
8065f56
60a7dd1
e397c42
 
 
 
8065f56
60a7dd1
e397c42
 
 
 
60a7dd1
 
e397c42
 
 
 
 
 
8065f56
60a7dd1
e397c42
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
* Lokasi: index.js
* Versi: v3
*/

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}`);
});