const express = require('express');
const bodyParser = require('body-parser');
const axios = require('axios');
const app = express();
const port = 3000;
app.use(bodyParser.json());
app.post('/chatbot', async (req, res) => {
const { message, intent } = req.body;
let response;
switch (intent) {
case 'inquiry':
response = "We offer professional commercial cleaning services, including office cleaning, deep cleaning, and janitorial services. How can I assist you further?";
break;
case 'quote':
response = "To provide a quote, please share details like the size of your space and the type of cleaning needed. You can also visit our website for a quick estimate.";
break;
case 'schedule':
response = "I can help schedule your cleaning appointment. Please provide the date, time, and location you'd like to book.";
break;
default:
response = "I'm here to assist with cleaning inquiries, quotes, and appointments. How can I help you today?";
}
res.json({ response });
});
app.listen(port, () => {
console.log(`Chatbot server running on port ${port}`);
});