Skip to content

Instantly share code, notes, and snippets.

@iMichaelOwolabi
Created September 30, 2022 23:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iMichaelOwolabi/5aa9ac993e3104aa7673143c135111c0 to your computer and use it in GitHub Desktop.
Save iMichaelOwolabi/5aa9ac993e3104aa7673143c135111c0 to your computer and use it in GitHub Desktop.
Final index.js code for the passwordless auth app
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