I think it would be cool to add category description to the Get Recent Topics API. Wondering if I can get that in a backlog somewhere.
thekook
Posts
-
Plans to add category description to Get Recent Topics API? -
Page loads blank until refreshCracked it! I had all this nonsense in my nginx from googling around. here is what worked.
location /forum { if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-AUTHENTICATION, X-IP, Accept'; add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Type' 'text/plain charset=UTF-8'; add_header 'Content-Length' 0; return 204; } if ($request_method = 'POST') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-AUTHENTICATION, X-IP, Accept'; } if ($request_method = 'GET') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-AUTHENTICATION, X-IP, Accept'; } add_header 'Access-Control-Allow-Credentials' 'true'; add_header X-Frame-Options "SAMEORIGIN"; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; # proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; proxy_pass http://127.0.0.1:4567; # no subfolder defined here proxy_set_header Host $host; # MAGIC proxy_redirect off; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }
-
Page loads blank until refreshSeems like it breaks when I remove :4567 from the URL. Otherwise it's happy.
-
Page loads blank until refreshHmm it doesn't!
{ "url": "http://localhost:4567", "secret": "secret", "database": "redis", "port": "4567", "redis": { "host": "127.0.0.1", "port": "6379", "password": "", "database": "0" } }
Changing it to where it actually loads:
"url": "http://localhost/forum",
or
"url": "http://localhost:4567/forum",
Causes this error when I refresh the forum.
(node:62717) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'sessionSharing' of undefined at Object.plugin.appendTemplate [as method] (/Users/mikebaker/access/NodeBB/node_modules/nodebb-plugin-session-sharing/library.js:636:23) at /Users/mikebaker/access/NodeBB/src/plugins/hooks.js:140:29 at new Promise (<anonymous>) at fireMethod (/Users/mikebaker/access/NodeBB/src/plugins/hooks.js:130:10) at Object.fireFilterHook [as filter] (/Users/mikebaker/access/NodeBB/src/plugins/hooks.js:159:18) at Hooks.fire (/Users/mikebaker/access/NodeBB/src/plugins/hooks.js:99:49) at Object.wrapperCallback [as fire] (/Users/mikebaker/access/NodeBB/src/promisify.js:46:11) at ServerResponse.renderOverride [as render] (/Users/mikebaker/access/NodeBB/src/middleware/render.js:42:45) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async Object.exports.send404 (/Users/mikebaker/access/NodeBB/src/controllers/404.js:63:2) (node:62717) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:62717) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
-
Page loads blank until refreshHey there my forum is running on /forum thanks to nginx, but I have this behavior where when I follow any NodeBB link (e.g. click on a category) the page first loads blank, but appears perfectly if I refresh/reload. The page isn't totally blank initially, but I see the loading circle graphic.
The only things I see in inspector is the socket.io polling and an error that doesn't exist if I refresh.
Console error:
ajaxify.js:84 Uncaught TypeError: Cannot read property 'name' of undefined at ajaxify.js:84 at Object.success (ajaxify.js:407) at c (jquery.js:3500) at Object.fireWith [as resolveWith] (jquery.js:3630) at E (jquery.js:9796) at XMLHttpRequest.<anonymous> (jquery.js:10057)
Thanks!
-
Write API GET works but POST 404s?Hey all-
I am a moron.
I forgot the /api/v3 in the API url.
fml
-
Write API GET works but POST 404s?Maybe something here?
location /forum/ { if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' 'http://127.0.0.1*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Type' 'text/plain charset=UTF-8'; add_header 'Content-Length' 0; return 204; } if ($request_method = 'POST') { add_header 'Access-Control-Allow-Origin' 'http://127.0.0.1*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; } proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://127.0.0.1:4567/; # no subfolder defined here proxy_redirect off; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }
-
Write API GET works but POST 404s?Hey hope I am not spamming here.
When I use axios to hit /ping on the Write API with a GET I recieve a 200 as expected. But when I try to POST I get a 404. Any ideas? Do POST requests require https? Could nginx be messing this up?
var token = my_token; function thisGetsA404(){ var payload = JSON.stringify( { "property1": null, "property2": null } ); axios .post('http://localhost/forum/ping', payload, { headers: { Authorization: `Bearer ${token}` } }) .then(res => { console.log(res.response) }) .catch(error => { console.error(error) }) } function thisGetsA200(){ axios .get('http://localhost/forum/api/unread?_uid=2',{ headers: { Authorization: `Bearer ${token}` } }) .then(res => { console.log(res) }) .catch(error => { console.error(error) }) }
-
/api/login return loggedin:falseOkay I bit the bullet and learned nginx and am off to the races.
-
/api/login return loggedin:falseSome more color here as I explore more, I shifted over to the write API and /ping returns a CORS error which is strange because the /api/unread gives me an Auth error.
Calling the API from a react app at localhost:3001 hmm
-
/api/login return loggedin:falseWhich is weird since I am logged in to localhost:4567 in the same browser tab and have the express cookie. Is there a config issue I am not considering?
ACP:
Access-Control-Allow-Origin
Access-Control-Allow-Origin Regular Expression
Set to 127.0.0.1Access-Control-Allow-Credentials
truevar url; if(process.env.NODE_ENV === 'production') url='tbd'; else url='http://localhost:4567/api/login'; axios.get(url,{credentials: 'include',withCredentials: true}).then(response =>{ console.log(response.data); }).catch(err =>{ console.log(err); })
-
Session-sharing id questionWhat is the purpose of sending an id in the JWT token if nodebb just makes a new user and increments the uid?
GitHub - julianlam/nodebb-plugin-session-sharing: Allows login sessions from your app to persist in NodeBB
Allows login sessions from your app to persist in NodeBB - julianlam/nodebb-plugin-session-sharing
GitHub (github.com)
Thanks
-
How far do people push nodebb?I've been digging around the net trying to find the right low cost approach to building a Yelp clone. User accounts with profiles, location pages with discussions. Seems like nobebb has a lot of this functionality in the form of a forum, but have people in the past used it to power products very different from its intended purpose?
Seems weird that if I need say 10,000 location pages, each would have an imbedded nodebb topic they would post to?
Any thoughts on the matter or examples of people who have pushed nodebb well beyond a forum would be great to hear!