Home > Software engineering >  when i use uuid the code unexpected crash, and then works fine?
when i use uuid the code unexpected crash, and then works fine?

Time:04-23

const express = require('express');
const { uuid } = require('uuidv4');


const app = express();

app.use(express.json())

const projects = [];

app.post('/projects', (req,res)=>{

 const { title, owner } = req.body;
 
  const project = { id: uuid() , title, owner };
  projects.push(project);

  return res.json(project)
})

app.listen(6690, ()=>{
  console.log('Started!           
  • Related