const app = new express();
app.use(express.json());
const server = createServer(app);
const io = new Server(server, {
// ...
});
app.use(express.static('static'));
app.post('/auth/register', async (req,res) => console.log(req.body));
SyntaxError: Unexpected token ' in JSON at position 12
at JSON.parse (<anonymous>)
at parse (D:\game\node_modules\body-parser\lib\types\json.js:89:19)
at D:\game\node_modules\body-parser\lib\read.js:128:18
at AsyncResource.runInAsyncScope (node:async_hooks:203:9)
at invokeCallback (D:\game\node_modules\raw-body\index.js:231:16)
at done (D:\game\node_modules\raw-body\index.js:220:7)
at IncomingMessage.onEnd (D:\game\node_modules\raw-body\index.js:280:7)
at IncomingMessage.emit (node:events:517:28)
at endReadableNT (node:internal/streams/readable:1368:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<form method="post" action="{{ route('user.reg') }}">
{!! csrf_field() !!}
<input name="name" placeholder="Введите свой ник">
<input name="email" type="email" value="{{ old('email') }}" placeholder="Введите свой email">
<input name="password" placeholder="Введите свой пароль">
<input style="margin: 10px;" type="checkbox" name="remember"> Запомнить меня
<button style="margin: 10px;" type="submit">Вход</button>
</form>
</body>
</html>