1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples/with-cookie-auth/api/index.js

21 lines
390 B
JavaScript
Raw Normal View History

const { send } = require('micro')
const login = require('./login')
const profile = require('./profile')
const dev = async (req, res) => {
switch (req.url) {
case '/api/profile.js':
await profile(req, res)
break
case '/api/login.js':
await login(req, res)
break
default:
send(res, 404, '404. Not found.')
break
}
}
module.exports = dev