Created
September 30, 2022 23:34
-
-
Save iMichaelOwolabi/5aa9ac993e3104aa7673143c135111c0 to your computer and use it in GitHub Desktop.
Final index.js code for the passwordless auth app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express'; | |
import { config } from 'dotenv'; | |
import { authRouter } from './src/routes/authRouter.js'; | |
config(); | |
const app = express(); | |
app.use(express.json()); | |
const port = process.env.PORT ?? 3000; | |
app.use('/api/v1/auth', authRouter); | |
app.get('/api/v1', (req, res) => { | |
res.send('Passwordless authentication powered by Redis'); | |
}); | |
app.listen(port, () => { | |
console.log(`Server running on: http://localhost:${port}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment