2024-03-01 19:28:20 +07:00

24 lines
661 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import express, { Request, Response } from 'express';
import { board, comport } from './setup';
import view from './routes/view';
import api from './routes/api';
const app = express();
const host = 'localhost';
const port = 3000;
app.use(express.static('client'));
app.use('/', view);
app.use('/api-arduino', api);
app.listen(port, host, () => {
console.log(`Server is running in ${host} at port ${port} 🗣️🗣️🗣️`);
console.log(`URL: http://${host}:${port}/\n`);
console.log("Connecting to Board");
board.on('ready', () => {
console.log(`Board at port ${comport} Connected!! (^o^)`);
})
});