import dotenv from 'dotenv';
import { createServer } from 'http';
import { app } from './app.js';

dotenv.config();

const PORT = process.env.PORT ? Number(process.env.PORT) : 4000;

const server = createServer(app);
server.listen(PORT, '0.0.0.0', () => {
  // eslint-disable-next-line no-console
  console.log(`Server listening on http://0.0.0.0:${PORT}`);
  // eslint-disable-next-line no-console
  console.log(`Also accessible at http://localhost:${PORT}`);
});
