app moved to next.js
This commit is contained in:
1 parent
dcca513aea
commit
43af2996bf
48 files changed
+1147
-1027
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { dbUri } from '../../src/config'
|
||||
import { connect } from '../../src/core/db'
|
||||
import { findSchedule } from '../../src/core/schedule'
|
||||
|
||||
export default async (req, res) => {
|
||||
await connect(dbUri)
|
||||
|
||||
const period = req.query.period
|
||||
const semester = req.query.semester
|
||||
const data = await findSchedule(period, semester)
|
||||
|
||||
if (data) {
|
||||
res.json(data)
|
||||
} else {
|
||||
res.status(404)
|
||||
res.json({
|
||||
error: `Schedule ${period}:${semester} not found`
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user