Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • Jun 19 12:31
    @texas2010 banned @therichaverma
  • Jun 19 2020 20:05
    @krisb1220 banned @Gastony
  • May 14 2020 22:39
    @bjorno43 banned @minitechtips_twitter
  • May 14 2020 22:38
    @bjorno43 banned @real-action
  • Feb 01 2020 00:26
    @bjorno43 banned @Ndoua
  • Jan 07 2020 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:32
    User @bjorno43 unbanned @linkin-park
  • Aug 17 2019 01:43
    @bjorno43 banned @linkin-park
  • Jun 20 2019 21:20
    @bjorno43 banned @shenerd140
  • May 10 2019 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 27 2019 19:47
    @mstellaluna banned @zhonghuacx
  • Apr 25 2019 17:12
    @mstellaluna banned @cmal
  • Jan 08 2019 22:00
    @mstellaluna banned @dertiuss323
  • Dec 15 2018 23:36
    @mstellaluna banned @18835579411
  • Dec 13 2018 23:57
    @mstellaluna banned @brandon6190
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:13
    User @bjorno43 unbanned @androuino
Himanshu maurya
I decided to work upon issue #39284 after understanding it correctly.( I didn't understood in the first go) I looked the code in many files but all in vain. Tried to understood it as much as possible but I was unable to fix that. Will someone help me in solving this issue or can help me in familiarising the code.
Harikesh Pallantla
hi all, can anyone tell me how to send record type as input in store procedure calls with hibernate
Riz Syed

hi all, can someone/a few of you please run this file on your machines and drop a message in the chat room that will launch? https://github.com/RS357/chat-app/blob/master/chat_client.py

I am trying to test it on other peoples machines. Thansk!

new here(Riddhi Jain)
Is here any beginner who would like to code by collaborating. PLease Inform
@RiddhiCoder depend on what ?
Neil Haria
@RS357 create a dockerfile which will help to work on possibly any machine.
John Melody Me
Anyone familiar with janus WebRtc ?
Richard Sithole

Hi there

I have an async function which I would like to convert to an Observable stream (using rxjs operators). The await calls must execute in the order they appear in the function.

async authenticateUser(profile: Profile): Promise<any> {

  let authCookie: any;

   try {

         authCookie = await getCookie();

    } catch (error) {



   if (!authCookie || authCookie?.length < 1) {


            throw {message: "login failed", status: -2};


    await saveProfileAsync(profile);

    await storeCurrentAuthCookieAsync(authCookie);


    await setPartitionSessionCookie(profile.url, authCookie);


Is there a clean way to accomplish the above?

@Sliqric7053 Any particular reason to convert it? Usually this should be doing just fine with promises as Observables are made for multiple values over time - and an authentication is rather a one-time thing
Richard Sithole
@alpox In the middle of a refactoring, and as a team, we've decided to move all Promise-based functions into Observables.. so basically, would like to convert the whole function into an Observable-returning one, while keeping the business logic
@Sliqric7053 if its just about RETURNING an observable you can just make another function which calls this async function with return Observable.of(authenticateUser(profile))
I dont see much use of refactoring the whole function to inner observables
Richard Sithole
@alpox was hoping to avoid using await key and concat the observables somewhat, but some of those await funcs do not return anything and I think I just get lost in all the many operators:( But I guess worst case scenario, that could still do the job. Thank you 🙏
If they do not return something the await is basically a no-op
It would do: await undefined; which does - nothing. You only need to use await on promises - respectively when a function returns a promise
You can ofc. refactor the whole thing to not use any async/await and promises but I think thats more of a chore and makes the function less readable
Richard Sithole
Makes sense. Thanks @alpox 👌🏽
Rahul Yedida

I'm frustrated after an hour of debugging this, maybe you guys can help. I have a file to interact with my MongoDB, and it has:

exports.getUserDetails = async username => {
    const client = new MongoClient(uri, { useNewUrlParser: true });
    client.connect(async err => {
        if (err) throw err;

        const collection = client.db('db').collection('users');
        const result = await collection.findOne({ username });

        return result;

and I call it as:

const details = await dbUtils.getUserDetails(username);
console.log(`got ${ details}`);  // prints "got undefined"
I have no idea why I'm getting undefined. If after the last await in my getUserDetails function I add a console.log, it prints out the object
@yrahul3910 you dont return anything from getUserDetails you only return from the callback to connect
Rahul Yedida
Ahh. Damn. Thanks!
What am u missing in this code ?
Kelechi Chinaka
:wave: everyone
Jason Luboff
Kelechi Chinaka
Good to see you @JLuboff
Been a while
Jason Luboff
Likewise, hope you've been doing well
Kelechi Chinaka
Yea always trying my best
The past year got me writing swift(iOS)
Just trying to find my backend footing again lol
What have you been up to lately? @JLuboff
Jason Luboff
Nice man. I've been crazy busy at working. Updating existing apps (both my own and the prior programmers), training a new guy, etc
Kelechi Chinaka
app.post('/register', async (req, res) => {  
  const { error } = schema.validate(req.body);
  if (error) {
    return res.status(401).json({
      status: false,
      message: error.details[0].message

  // Check if user is already in DB
  const userEmailExist = await User.findOne({ email: req.body.email });
  if (userEmailExist) {
    return res.status(409).json({
      status: false,
      message: "Email already exists"

  // Hash user password
  const salt = await bcrypt.genSalt(10);
  const hashedPassword = await bcrypt.hash(req.body.password, salt);

  // Create new user and save to MongoDB
  const user = new User({
    name: req.body.name,
    email: req.body.email,
    emailToken: crypto.randomBytes(64).toString('hex'),
    password: hashedPassword

  const msg = {
    to: user.email, // Change to your recipient
    from: 'mrkelechichinaka@gmail.com', // Change to your verified sender
    subject: 'Account Verification Token',
    text: `
      Hello, thanks for registering on our site.
      Please copy and paste the address below to verify your account.
    html: `
      <p>Thanks for registering on our site.</p>
      <p>Please click the link below to verify your account.</p>

  try {
    await user.save();
    await sgMail.send(msg)
    res.send(`Email sent successfully to ${user.email}`);
  } catch (error) {    
    res.send(`Something went wrong. Please contact us noreply@gmail.com`);
I'm trying to implement email verification signup, above is my code
it saves to the db successfully, sends mail to user. then server crashes
Jason Luboff
Whats the error when it crashes
Kelechi Chinaka
throws me this error =>Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
Jason Luboff
Oh... its becuase you have res.send followed by a redirect...you can't do that as send is sending the http response
Kelechi Chinaka
ok. so i cant do both?
Jason Luboff
Kelechi Chinaka
oh wow and I've been looking at this screen wondering whats go wrong
thanks @JLuboff
Hey guys. I've just finished the url shortener. I couldn't get it to work on repl or glitch but it works locally and also on heroku. Is this sufficient to past the challenge?(I intend to refactor it). https://url-shortener-micro-service.herokuapp.com/ github: https://github.com/kbventures/URL-Shortener-Microservice
anyone online??
Tunde Oretade

hi guys I kinda need urgent help right now. I have an assignment but currently I have a little challenge with connecting parts. Here is the task

a web app which logs calculations as they happen and shares those calculations with everyone connected to the app.

currently I have implemented a calculator using React and it works perfectly I have also setup a server using node, express and socket.io my current challenge is how to get inputs from the calculator to be displayed in a form of chats which is the socket.io and node setup. Any input is appreciated.

Christopher McCormack
Hello! If you are new here and want to join the conversation, please head over to the freeCodeCamp Discord channel! https://www.freecodecamp.org/news/freecodecamp-discord-chat-room-server/
Tunde Oretade

hi guys i need help with this:

filterData = () => {
      const {
        enrollee, id,
      } = this.state;
      const newData = enrollee.filter(data => {
        if (data.id === id) {
          return data;
        return null;

      this.setState({ singleUser: newData });

what am I doing wrong?

Jagdish Parihar
Hi. I want to design a project using MVC in express.
Can anyone help me with the design I should follow for that.
I want to know. What should be the folder structure look like
so that, it can be easily modifiable in the future
Vanessa Correia
have you tried using express-generator, @jatin510? take a look here: https://expressjs.com/en/starter/generator.html