|
@@ -11,6 +11,18 @@ module.exports = function (app, db) {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+ //查询答案的接口
|
|
|
+ app.get("/answer/:id", (req, res) => {
|
|
|
+ const id = req.params.id
|
|
|
+ const details = {"hid":id}
|
|
|
+ db.collection('vueanswer').findOne(details, (err, item) => {
|
|
|
+ if (err) {
|
|
|
+ res.send({'error':'An error has occurred'});
|
|
|
+ } else {
|
|
|
+ res.send(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+});
|
|
|
app.post("/notes", (req, res) => {
|
|
|
const note = {
|
|
|
name: req.body.name,
|