mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
21 lines
390 B
JavaScript
21 lines
390 B
JavaScript
|
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
|