NodeBB | Node.js based forum software built for the modern web | Websocket library
kandi X-RAY | NodeBB Summary
kandi X-RAY | NodeBB Summary
NodeBB Forum Software is powered by Node.js and supports either Redis, MongoDB, or a PostgreSQL database. It utilizes web sockets for instant interactions and real-time notifications. NodeBB takes the best of the modern web: real-time streaming discussions, mobile responsiveness, and rich RESTful read/write APIs, while staying true to the original bulletin board/forum format → categorical hierarchies, local user accounts, and asynchronous messaging. NodeBB by itself contains a "common core" of basic functionality, while additional functionality and integrations are enabled through the use of third-party plugins.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Set the graph
- Check for upgrading .
- Adds handlers for component
- Create the user command
- Prepare list of available widgets .
- Handle item navigation
- Sets up the AD search
- Add anchors to an anchor .
- Create the adminset password
- Update user data
NodeBB Key Features
NodeBB Examples and Code Snippets
Community Discussions
Trending Discussions on NodeBB
QUESTION
I am writing a private plugin for nodebb (open forum software). In the nodebb's webserver.js file there is a line that seems to be hogging all incoming json data.
app.use(bodyParser.json(jsonOpts));
I am trying to convert all incoming json data for one of my end-points into raw data. However the challenge is I cannot remove or modify the line above.
The following code works ONLY if I temporarily remove the line above.
...ANSWER
Answered 2020-Feb-05 at 01:47The bodyParser.json()
middleware does the following:
- Check the response type of an incoming request to see if it is
application/json
. - If it is that type, then read the body from the incoming stream to get all the data from the stream.
- When it has all the data from the stream, parse it as JSON and put the result into
req.body
so follow-on request handlers can access the already-read and already-parsed data there.
Because it reads the data from the stream, there is no longer any more data in the stream. Unless it saves the raw data somewhere (I haven't looked to see if it does), then the original RAW data is gone - it's been read from the stream already. This is why you can't have multiple different middleware all trying to process the same request body. Whichever one goes first reads the data from the incoming stream and then the original data is no longer there in the stream.
To help you find a solution, we need to know what end-problem you're really trying to solve? You will not be able to have two middlewares both looking for the same content-type and both reading the request body. You could replace bodyParser.json()
that does both what it does now and does something else for your purpose in the same middleware, but not in separate middleware.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install NodeBB
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page