Update app.js

This commit is contained in:
nune 2024-12-19 19:12:43 -05:00 committed by GitHub
parent 24b0d577e9
commit 3be15e71cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

8
app.js
View File

@ -1,10 +1,18 @@
const express = require('express');
const fetch = require('node-fetch');
const cookieParser = require('cookie-parser');
const app = express();
const PORT = process.env.PORT || 3000;
app.use(express.static('public'));
app.use(cookieParser());
const autoCopyDefault = process.env.AUTO_COPY_DEFAULT === 'false';
app.get('/auto-copy-default', (req, res) => {
res.json({ autoCopyDefault });
});
// Route to handle raw Pastebin requests
app.get('/:pasteId', async (req, res) => {