Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ZwaneProgram committed May 27, 2024
1 parent d300ef5 commit 638bb88
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ const app = express();
app.use(express.json());

const corsOptions = {
methods: 'POST',
allowedHeaders: ['Content-Type', 'Authorization'],
origin: 'https://linebot-fullstack.vercel.app',
methods: ['GET', 'POST'],
allowedHeaders: ['Content-Type', 'Authorization'], // Added comma here
credentials: true,
};
app.use(cors(corsOptions));
Expand All @@ -24,6 +25,7 @@ const headers = {
};

app.post('/api/send-message', async (req, res) => {
res.send('Hello from the API endpoint!');
try {
const { userId, message } = req.body;
console.log(`Sending message to userId: ${userId}`);
Expand Down

0 comments on commit 638bb88

Please sign in to comment.