add a webroot

This commit is contained in:
Paul Fitzpatrick
2021-11-26 17:39:46 +00:00
parent e7b09970fc
commit d804af2e56
2 changed files with 3 additions and 6 deletions

View File

@@ -15,14 +15,9 @@ const workDir = '/tmp/makesweet-api'
const upload = multer({ dest: workDir })
const app = express()
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.use(express.static('public'));
app.post('/make/:template', upload.any('images'), handleErrors, (req, res) => {
// if (!req.files) {
// throw new ApiError(400, 'i hunger for images...');
// }
const textHtml = `${process.cwd()}/text.html`;
const output = `${workDir}/${uuid.v4()}.gif`;
const template = getTemplatePathFromName(req.params.template);

2
public/index.html Normal file
View File

@@ -0,0 +1,2 @@
Hello! This is the makesweet api. Welcome.