Problem with access token in Strava API v3 GET all athlete activities

On October 15, 2018 Strava enhanched the authorization process introducing new list of scopes. Are you using the access token you find on https://www.strava.com/settings/api? This token has scope:read that maybe is not enough to do what you want (i.e. are your activities public or private?). If you need a new token with different scopes you … Read more

How to fix (node:12388) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated in windows

Node version 12 depracated OutgoingMessage.prototype._headers, which is used in http-server. Issue is listed at: https://github.com/http-party/http-server/issues/537 https://nodejs.org/api/deprecations.html#deprecations_dep0066_outgoingmessage_prototype_headers_outgoingmessage_prototype_headernames Using node 12.0.0 I get the same error using http-server. Switching to 10.11.0 removes the error.

req.header vs req.headers in Express

The problem arises because in the HTTP protocol, headers are case-insensitive. This means that content-type, Content-Type, and coNTEnt-tYPe all refer to the same header, and the Express framework needs to be able to handle any of them. The different between req.headers (the object) and req.header (the function) is simply this: If you want to get … Read more

ExpressJS & Websocket & session sharing

I found this works for me. Not sure it’s the best way to do this though. First, initialize your express application: // whatever your express app is using here… var session = require(“express-session”); var sessionParser = session({ store: session_store, cookie: {secure: true, maxAge: null, httpOnly: true} }); app.use(sessionParser); Now, explicitly call the session middleware from … Read more

Error [ERR_REQUIRE_ESM]: require() of ES Module … not supported

The current version of node-fetch is ONLY compatible with an ESM import (using import), not from CommonJS modules using require(). You have these choices to fix: Switch your project to an ESM module and load it with import fetch from ‘node-fetch’;. In a very recent version of nodejs, you can dynamically import an ESM module … Read more

Find documents with array that doesn’t contains a specific value

Nothing wrong with what you are basically attempting, but perhaps the only clarification here is the common misconception that you need operators like $nin or $in when querying an array. Also you really need to do here is a basic inequality match with $ne: Person.find({ “groups”: { “$ne”: group._id } }) The “array” operators are … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)