Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
Postman is not responding and hashedPassword is not generated

I am simply trying to create a hashedpassword using bcryptjs and console.log that password so that I can copy and use it

i am using postman to test my POST request my plan is to send the request body as(email, password) using postman and i will read the body and pass the password to bcryptjs which will generate a hashedpassword and i want to console.log that out

now hashedpassword is not generated and also postman is not responding please help

index.js:

require('dotenv').config()
const exppess=require('express')
const cookieParser=require('cookie-parser')
const cors=require('cors')
const { verify }=require('jsonwebtoken')
const { hash, compare } = require('bcryptjs');
const bcrypt = require("bcrypt");
const { DB } = require('./DB');

const server=exppess()
server.use(cookieParser )


server.use(exppess.json )
server.use(exppess.urlencoded({ extended: true }))


server.post("/register",async (req,res)=>{
  const { email, password } = req.body
  try{
    const hashedPassword = await hash(password, 10)
    console.log(hashedPassword)
  }
  catch(err){
    res.send({
      error: `${err.message}`,
    })
  }
})

server.listen(process.env.PORT, () => {
    console.log('server started on port: '+process.env.PORT);
 });

 

.env file

ACCESS_TOKEN_SECRET=weibenrules
REFRESH_TOKEN_SECRET=weibenrulesevenmore
PORT=4000

Terminal:screenshot enter image description here

Postman: in the body i am setting email and password as key value pair enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

require('dotenv').config()
const exppess=require('express')
const cookieParser=require('cookie-parser')
const cors=require('cors')
const { verify }=require('jsonwebtoken')
const { hash, compare } = require('bcryptjs');
const bcrypt = require("bcrypt");
const { DB } = require('./DB');

const server=exppess()
server.use(cookieParser )


server.use(exppess.json )
server.use(exppess.urlencoded({ extended: true }))


server.post("/register",async (req,res)=>{
  const { email, password } = req.body
  try{
    const hashedPassword = await hash(password, 10)
    console.log(hashedPassword)
    res.send(hashedPassword)
  }
  catch(err){
    res.send({
      error: `${err.message}`,
    })
  }
})

server.listen(process.env.PORT, () => {
    console.log('server started on port: '+process.env.PORT);
 });

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!