0

This is my current code:

const mongoose = require("mongoose")
const params = new URLSearchParams(window.location.search)
module.exports = (req, res) => {
    
    res.send({
        creatorid: "",
        whitelisted: false
    })
}

At the moment, it is giving me the error: window is not defined. I have no idea why. Can someone help please?

Sprocx
  • 87
  • 7

1 Answers1

0

As it was mentioned above. There is no window object in Node enviroment.

If you are using Express

var express = require('express');
var app = express();

app.get('/', function(req, res){
    res.send('id: ' + req.query.id);
});

app.listen(3000);

Also check out this and this thred

tiborK
  • 385
  • 1
  • 6