import express from 'express';
import cors from 'cors';
 
const app = express();
const port = process.env.PORT? Number(process.env.PORT) : 4000;

app.use(cors());

app.get('/', (req, res) => {  
  res.send('Hello World!');
});

app.get('/api/data', (req, res) => {
  res.json({ message: 'This is some data from the server!' });
});

app.listen(port, '0.0.0.0', () => {
  console.log(`Server is running on port ${port}`);
});
