generated from lucien/api-template
add: added mentions
This commit is contained in:
parent
dfb6639ecf
commit
6c8f354bf6
9 changed files with 208 additions and 9 deletions
14
back/api/searchuser.js
Normal file
14
back/api/searchuser.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
const express = require('express');
|
||||
const { getConnection, searchUser } = require('../libs/mysql');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/', async (req, res) => {
|
||||
const { search } = req.query;
|
||||
const connection = await getConnection();
|
||||
const users = await searchUser(connection, search);
|
||||
connection.end();
|
||||
res.send(users);
|
||||
});
|
||||
|
||||
module.exports = router;
|
Loading…
Add table
Add a link
Reference in a new issue