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)