mirror of
https://github.com/DeNNiiInc/Advanced-Smtp-Tester.git
synced 2026-04-17 17:35:59 +00:00
Fix server.js to support root index.html
This commit is contained in:
11
server.js
11
server.js
@@ -9,9 +9,16 @@ const port = process.env.PORT || 3000;
|
||||
|
||||
app.use(cors());
|
||||
app.use(bodyParser.json());
|
||||
app.use(express.static(path.join(__dirname, "public")));
|
||||
|
||||
app.post("/api/test-smtp", async (req, res) => {
|
||||
// Serve static files from the "public" directory under the "/public" path
|
||||
app.use('/public', express.static(path.join(__dirname, 'public')));
|
||||
|
||||
// Serve index.html from the root directory
|
||||
app.get('/', (req, res) => {
|
||||
res.sendFile(path.join(__dirname, 'index.html'));
|
||||
});
|
||||
|
||||
app.post('/api/test-smtp', async (req, res) => {
|
||||
const { host, port, secure, user, pass, from, to } = req.body;
|
||||
|
||||
// Log intent
|
||||
|
||||
Reference in New Issue
Block a user