Skip to content

Commit

Permalink
Update app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nilupulmadhawa committed May 10, 2024
1 parent 351c7ea commit b879a49
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions auth_service/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import routes from './routes/index.routes';

const { errors } = require('celebrate');

const port = process.env.PORT || 3001;
dotenv.config();

const app = express();
Expand All @@ -19,14 +20,16 @@ app.use(express.json({ limit: '1mb' }));

app.use(express.urlencoded({ extended: true }));

app.get('/', (req, res) => res.status(200).json({ message: 'Server Up and Running' }));
app.get('/', (req, res) => {
console.log(`Server successfully started on port ${port}`)
res.status(200).json({ message: 'Server Up and Running' })
});

app.use('/api', routes);
app.use(errors())

connectDB();

const port = process.env.PORT || 3001;

app.listen(port, () => {
console.log(`Server successfully started on port ${port}`)
Expand Down

0 comments on commit b879a49

Please sign in to comment.