diff options
author | Biswakalyan Bhuyan <biswa@surgot.in> | 2024-07-18 14:56:39 +0530 |
---|---|---|
committer | Biswakalyan Bhuyan <biswa@surgot.in> | 2024-07-18 14:56:39 +0530 |
commit | 2f613682b733f8f03634df08270469830cad1800 (patch) | |
tree | bab1e0c7b19aa9538bbcb099d7e5b36c1f264528 /server/server.js | |
parent | 05faaf231620ce8d4ee67585bd86f1e97fd32eeb (diff) | |
download | admin-panel-2f613682b733f8f03634df08270469830cad1800.tar.gz admin-panel-2f613682b733f8f03634df08270469830cad1800.tar.bz2 admin-panel-2f613682b733f8f03634df08270469830cad1800.zip |
added the config and setup the basic auth
Diffstat (limited to 'server/server.js')
-rw-r--r-- | server/server.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/server/server.js b/server/server.js new file mode 100644 index 0000000..8836667 --- /dev/null +++ b/server/server.js @@ -0,0 +1,14 @@ +const express = require('express'); +const connectDB = require('./config/db'); +const cors = require('cors'); +const app = express(); +require('dotenv').config(); + +connectDB(); +app.use(cors()); +app.use(express.json()); + +app.use('/api/auth', require('./routes/auth')); + +const PORT = process.env.PORT || 5000; +app.listen(PORT, () => console.log(`Server started on port ${PORT}`)); |