This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/server/user.js

20 lines
509 B
JavaScript
Raw Normal View History

2020-10-13 12:49:08 -07:00
import jwt from './jwt';
import { makeId } from '../src/helpers';
export default async function (req, res, next) {
const db = await dbConnection();
let result = {error: 'Not found'}
if (req.method === 'GET' && req.url === '/all') {
jwt.sign({
username: 'andrea',
email: 'andrea@avris.it',
secret: makeId(6, '0123456789'),
})
}
res.setHeader('content-type', 'application/json');
res.write(JSON.stringify(result));
res.end();
}