factly / dega-api-rest Goto Github PK
View Code? Open in Web Editor NEWTHIS REPO IS DEPRECATED. Please check https://github.com/factly/dega-api for the GraphQL API that will be maintained going forward
THIS REPO IS DEPRECATED. Please check https://github.com/factly/dega-api for the GraphQL API that will be maintained going forward
2019-04-01T22:20:43.031Z [DEGA-API] INFO: request_id=eac955f2-a8ab-56cf-afef-ff57f0636ed1 controller=factchecks operation=getFactcheck message='Converting degaUsers to authors'
2019-04-01T22:20:43.032Z [DEGA-API] INFO: request_id=eac955f2-a8ab-56cf-afef-ff57f0636ed1 controller=factchecks operation=getFactcheck message='Expanding sub-documents'
2019-04-01T22:20:43.312Z [DEGA-API] DEBUG: request_id=eac955f2-a8ab-56cf-afef-ff57f0636ed1 controller=factchecks operation=getFactcheck message='Ignoring factcheck 5c82539455a7540001fcb8ab - not published'
2019-04-01T22:20:43.562Z [DEGA-API] INFO: request_id=eac955f2-a8ab-56cf-afef-ff57f0636ed1 controller=factchecks operation=getFactcheck url=/api/v1/factchecks/?client_id=factly method=GET env=development remote_ip=::ffff:10.60.2.1 status=200 response_time=618 millis
2019-04-01T22:21:37.163Z [DEGA-API] INFO: request_id=14f0eb28-d297-50b2-b80b-d7fb4bf1fc8f controller=posts operation=getPosts message='Query Object {}'
2019-04-01T22:21:37.205Z [DEGA-API] INFO: request_id=14f0eb28-d297-50b2-b80b-d7fb4bf1fc8f controller=posts operation=getPosts message='Converting degaUsers to authors'
2019-04-01T22:21:37.206Z [DEGA-API] INFO: request_id=14f0eb28-d297-50b2-b80b-d7fb4bf1fc8f controller=posts operation=getPosts message='Expanding sub-documents'
2019-04-01T22:21:37.217Z [DEGA-API] INFO: request_id=14f0eb28-d297-50b2-b80b-d7fb4bf1fc8f controller=posts operation=getPosts url=/api/v1/posts/?client_id=factly-telugu&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=57 millis
2019-04-01T22:21:37.242Z [DEGA-API] INFO: request_id=8689fcc4-0d99-59d9-8fc1-47c0418a5456 controller=factchecks operation=getFactcheck message='Converting degaUsers to authors'
2019-04-01T22:21:37.242Z [DEGA-API] INFO: request_id=8689fcc4-0d99-59d9-8fc1-47c0418a5456 controller=factchecks operation=getFactcheck message='Expanding sub-documents'
2019-04-01T22:21:37.341Z [DEGA-API] DEBUG: request_id=8689fcc4-0d99-59d9-8fc1-47c0418a5456 controller=factchecks operation=getFactcheck message='Ignoring factcheck 5c82539455a7540001fcb8ab - not published'
2019-04-01T22:21:37.420Z [DEGA-API] INFO: request_id=8689fcc4-0d99-59d9-8fc1-47c0418a5456 controller=factchecks operation=getFactcheck url=/api/v1/factchecks/?client_id=factly-telugu&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=189 millis
2019-04-01T22:21:41.163Z [DEGA-API] INFO: request_id=ec5c6c6a-51c2-5bc3-a51f-97fbe856cbb2 controller=posts operation=getPosts message='Query Object {}'
2019-04-01T22:21:41.167Z [DEGA-API] INFO: request_id=ec5c6c6a-51c2-5bc3-a51f-97fbe856cbb2 controller=posts operation=getPosts message='Converting degaUsers to authors'
2019-04-01T22:21:41.203Z [DEGA-API] INFO: request_id=ec5c6c6a-51c2-5bc3-a51f-97fbe856cbb2 controller=posts operation=getPosts message='Expanding sub-documents'
2019-04-01T22:21:41.213Z [DEGA-API] INFO: request_id=ec5c6c6a-51c2-5bc3-a51f-97fbe856cbb2 controller=posts operation=getPosts url=/api/v1/posts/?client_id=factly&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=52 millis
2019-04-01T22:21:41.233Z [DEGA-API] INFO: request_id=a8dceb56-1884-5d66-8cf9-cb5653442e5e controller=factchecks operation=getFactcheck message='Converting degaUsers to authors'
2019-04-01T22:21:41.233Z [DEGA-API] INFO: request_id=a8dceb56-1884-5d66-8cf9-cb5653442e5e controller=factchecks operation=getFactcheck message='Expanding sub-documents'
2019-04-01T22:21:41.420Z [DEGA-API] DEBUG: request_id=a8dceb56-1884-5d66-8cf9-cb5653442e5e controller=factchecks operation=getFactcheck message='Ignoring factcheck 5c82539455a7540001fcb8ab - not published'
2019-04-01T22:21:41.527Z [DEGA-API] INFO: request_id=a8dceb56-1884-5d66-8cf9-cb5653442e5e controller=factchecks operation=getFactcheck url=/api/v1/factchecks/?client_id=factly&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=303 millis
2019-04-01T22:21:57.733Z [DEGA-API] INFO: request_id=29a9ec44-706b-5fe5-ac02-138d95a15b36 controller=posts operation=getPosts message='Query Object {}'
2019-04-01T22:21:57.803Z [DEGA-API] INFO: request_id=29a9ec44-706b-5fe5-ac02-138d95a15b36 controller=posts operation=getPosts message='Converting degaUsers to authors'
2019-04-01T22:21:57.804Z [DEGA-API] INFO: request_id=29a9ec44-706b-5fe5-ac02-138d95a15b36 controller=posts operation=getPosts message='Expanding sub-documents'
2019-04-01T22:21:57.813Z [DEGA-API] INFO: request_id=29a9ec44-706b-5fe5-ac02-138d95a15b36 controller=posts operation=getPosts url=/api/v1/posts/?client_id=factly-telugu&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=82 millis
2019-04-01T22:21:57.838Z [DEGA-API] INFO: request_id=d152fe19-4267-538a-901c-d67c8d6363f5 controller=factchecks operation=getFactcheck message='Converting degaUsers to authors'
2019-04-01T22:21:57.838Z [DEGA-API] INFO: request_id=d152fe19-4267-538a-901c-d67c8d6363f5 controller=factchecks operation=getFactcheck message='Expanding sub-documents'
2019-04-01T22:21:57.919Z [DEGA-API] DEBUG: request_id=d152fe19-4267-538a-901c-d67c8d6363f5 controller=factchecks operation=getFactcheck message='Ignoring factcheck 5c82539455a7540001fcb8ab - not published'
2019-04-01T22:21:58.010Z [DEGA-API] INFO: request_id=d152fe19-4267-538a-901c-d67c8d6363f5 controller=factchecks operation=getFactcheck url=/api/v1/factchecks/?client_id=factly-telugu&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=181 millis
2019-04-01T22:22:01.763Z [DEGA-API] INFO: request_id=cdfd977c-eba1-5972-8807-e44797e22a5a controller=posts operation=getPosts message='Query Object {}'
2019-04-01T22:22:01.766Z [DEGA-API] INFO: request_id=cdfd977c-eba1-5972-8807-e44797e22a5a controller=posts operation=getPosts message='Converting degaUsers to authors'
2019-04-01T22:22:01.766Z [DEGA-API] INFO: request_id=cdfd977c-eba1-5972-8807-e44797e22a5a controller=posts operation=getPosts message='Expanding sub-documents'
2019-04-01T22:22:01.807Z [DEGA-API] INFO: request_id=cdfd977c-eba1-5972-8807-e44797e22a5a controller=posts operation=getPosts url=/api/v1/posts/?client_id=factly&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=45 millis
2019-04-01T22:22:01.829Z [DEGA-API] INFO: request_id=e929cb4c-0b66-55f7-bf88-7f9ea6d61472 controller=factchecks operation=getFactcheck message='Converting degaUsers to authors'
2019-04-01T22:22:01.829Z [DEGA-API] INFO: request_id=e929cb4c-0b66-55f7-bf88-7f9ea6d61472 controller=factchecks operation=getFactcheck message='Expanding sub-documents'
2019-04-01T22:22:01.918Z [DEGA-API] DEBUG: request_id=e929cb4c-0b66-55f7-bf88-7f9ea6d61472 controller=factchecks operation=getFactcheck message='Ignoring factcheck 5c82539455a7540001fcb8ab - not published'
2019-04-01T22:22:02.023Z [DEGA-API] INFO: request_id=e929cb4c-0b66-55f7-bf88-7f9ea6d61472 controller=factchecks operation=getFactcheck url=/api/v1/factchecks/?client_id=factly&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=202 millis
2019-04-01T22:22:43.403Z [DEGA-API] INFO: request_id=dff9ea64-3c1f-5fcc-8bee-3d3e6b9c446d controller=factchecks operation=getFactcheck message='Converting degaUsers to authors'
2019-04-01T22:22:43.403Z [DEGA-API] INFO: request_id=dff9ea64-3c1f-5fcc-8bee-3d3e6b9c446d controller=factchecks operation=getFactcheck message='Expanding sub-documents'
2019-04-01T22:22:43.521Z [DEGA-API] DEBUG: request_id=dff9ea64-3c1f-5fcc-8bee-3d3e6b9c446d controller=factchecks operation=getFactcheck message='Ignoring factcheck 5c82539455a7540001fcb8ab - not published'
2019-04-01T22:22:43.733Z [DEGA-API] INFO: request_id=dff9ea64-3c1f-5fcc-8bee-3d3e6b9c446d controller=factchecks operation=getFactcheck url=/api/v1/factchecks/ method=GET env=development remote_ip=::ffff:10.128.0.50 status=200 response_time=348 millis
2019-04-01T22:22:57.199Z [DEGA-API] INFO: request_id=dbb334ce-74f2-5019-9ad0-81cdd8bae38b controller=posts operation=getPosts message='Query Object {}'
2019-04-01T22:22:57.202Z [DEGA-API] INFO: request_id=dbb334ce-74f2-5019-9ad0-81cdd8bae38b controller=posts operation=getPosts message='Converting degaUsers to authors'
2019-04-01T22:22:57.203Z [DEGA-API] INFO: request_id=dbb334ce-74f2-5019-9ad0-81cdd8bae38b controller=posts operation=getPosts message='Expanding sub-documents'
2019-04-01T22:22:57.209Z [DEGA-API] INFO: request_id=dbb334ce-74f2-5019-9ad0-81cdd8bae38b controller=posts operation=getPosts url=/api/v1/posts/?client_id=factly-telugu&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=12 millis
2019-04-01T22:22:57.236Z [DEGA-API] INFO: request_id=31825481-5828-5a28-a462-1776095ea2d4 controller=factchecks operation=getFactcheck message='Converting degaUsers to authors'
2019-04-01T22:22:57.237Z [DEGA-API] INFO: request_id=31825481-5828-5a28-a462-1776095ea2d4 controller=factchecks operation=getFactcheck message='Expanding sub-documents'
2019-04-01T22:22:57.338Z [DEGA-API] DEBUG: request_id=31825481-5828-5a28-a462-1776095ea2d4 controller=factchecks operation=getFactcheck message='Ignoring factcheck 5c82539455a7540001fcb8ab - not published'
2019-04-01T22:22:57.423Z [DEGA-API] INFO: request_id=31825481-5828-5a28-a462-1776095ea2d4 controller=factchecks operation=getFactcheck url=/api/v1/factchecks/?client_id=factly-telugu&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=195 millis
2019-04-01T22:23:01.167Z [DEGA-API] INFO: request_id=d8aa75bf-7151-530b-96ef-928db9c8f11c controller=posts operation=getPosts message='Query Object {}'
2019-04-01T22:23:01.170Z [DEGA-API] INFO: request_id=d8aa75bf-7151-530b-96ef-928db9c8f11c controller=posts operation=getPosts message='Converting degaUsers to authors'
2019-04-01T22:23:01.170Z [DEGA-API] INFO: request_id=d8aa75bf-7151-530b-96ef-928db9c8f11c controller=posts operation=getPosts message='Expanding sub-documents'
2019-04-01T22:23:01.209Z [DEGA-API] INFO: request_id=d8aa75bf-7151-530b-96ef-928db9c8f11c controller=posts operation=getPosts url=/api/v1/posts/?client_id=factly&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=43 millis
2019-04-01T22:23:01.228Z [DEGA-API] INFO: request_id=73bc0eea-d6ef-5e93-b2a7-27ebee34c944 controller=factchecks operation=getFactcheck message='Converting degaUsers to authors'
2019-04-01T22:23:01.229Z [DEGA-API] INFO: request_id=73bc0eea-d6ef-5e93-b2a7-27ebee34c944 controller=factchecks operation=getFactcheck message='Expanding sub-documents'
2019-04-01T22:23:01.409Z [DEGA-API] DEBUG: request_id=73bc0eea-d6ef-5e93-b2a7-27ebee34c944 controller=factchecks operation=getFactcheck message='Ignoring factcheck 5c82539455a7540001fcb8ab - not published'
2019-04-01T22:23:01.420Z [DEGA-API] INFO: request_id=73bc0eea-d6ef-5e93-b2a7-27ebee34c944 controller=factchecks operation=getFactcheck url=/api/v1/factchecks/?client_id=factly&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=200 millis
2019-04-01T22:23:57.173Z [DEGA-API] INFO: request_id=bb9abe1c-2598-5442-afd1-e6e4b329ba61 controller=posts operation=getPosts message='Query Object {}'
2019-04-01T22:23:57.177Z [DEGA-API] INFO: request_id=bb9abe1c-2598-5442-afd1-e6e4b329ba61 controller=posts operation=getPosts message='Converting degaUsers to authors'
2019-04-01T22:23:57.203Z [DEGA-API] INFO: request_id=bb9abe1c-2598-5442-afd1-e6e4b329ba61 controller=posts operation=getPosts message='Expanding sub-documents'
2019-04-01T22:23:57.211Z [DEGA-API] INFO: request_id=bb9abe1c-2598-5442-afd1-e6e4b329ba61 controller=posts operation=getPosts url=/api/v1/posts/?client_id=factly-telugu&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=40 millis
2019-04-01T22:23:57.234Z [DEGA-API] INFO: request_id=87c69481-f570-5511-9a1e-6f2cf2399afc controller=factchecks operation=getFactcheck message='Converting degaUsers to authors'
2019-04-01T22:23:57.235Z [DEGA-API] INFO: request_id=87c69481-f570-5511-9a1e-6f2cf2399afc controller=factchecks operation=getFactcheck message='Expanding sub-documents'
2019-04-01T22:23:57.403Z [DEGA-API] DEBUG: request_id=87c69481-f570-5511-9a1e-6f2cf2399afc controller=factchecks operation=getFactcheck message='Ignoring factcheck 5c82539455a7540001fcb8ab - not published'
2019-04-01T22:23:57.434Z [DEGA-API] INFO: request_id=87c69481-f570-5511-9a1e-6f2cf2399afc controller=factchecks operation=getFactcheck url=/api/v1/factchecks/?client_id=factly-telugu&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=206 millis
2019-04-01T22:24:01.173Z [DEGA-API] INFO: request_id=3222276e-95d2-5762-8eb2-cc6446c861ef controller=posts operation=getPosts message='Query Object {}'
2019-04-01T22:24:01.211Z [DEGA-API] INFO: request_id=3222276e-95d2-5762-8eb2-cc6446c861ef controller=posts operation=getPosts message='Converting degaUsers to authors'
2019-04-01T22:24:01.211Z [DEGA-API] INFO: request_id=3222276e-95d2-5762-8eb2-cc6446c861ef controller=posts operation=getPosts message='Expanding sub-documents'
2019-04-01T22:24:01.222Z [DEGA-API] INFO: request_id=3222276e-95d2-5762-8eb2-cc6446c861ef controller=posts operation=getPosts url=/api/v1/posts/?client_id=factly&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=50 millis
2019-04-01T22:24:01.249Z [DEGA-API] INFO: request_id=fdef723b-c60f-52b9-b920-8a531c6dac14 controller=factchecks operation=getFactcheck message='Converting degaUsers to authors'
2019-04-01T22:24:01.258Z [DEGA-API] INFO: request_id=fdef723b-c60f-52b9-b920-8a531c6dac14 controller=factchecks operation=getFactcheck message='Expanding sub-documents'
2019-04-01T22:24:01.345Z [DEGA-API] DEBUG: request_id=fdef723b-c60f-52b9-b920-8a531c6dac14 controller=factchecks operation=getFactcheck message='Ignoring factcheck 5c82539455a7540001fcb8ab - not published'
2019-04-01T22:24:01.417Z [DEGA-API] INFO: request_id=fdef723b-c60f-52b9-b920-8a531c6dac14 controller=factchecks operation=getFactcheck url=/api/v1/factchecks/?client_id=factly&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=177 millis
2019-04-01T22:24:57.121Z [DEGA-API] INFO: request_id=bcb68fcf-9586-586b-a6a7-b58086f47a5d controller=posts operation=getPosts message='Query Object {}'
2019-04-01T22:24:57.124Z [DEGA-API] INFO: request_id=bcb68fcf-9586-586b-a6a7-b58086f47a5d controller=posts operation=getPosts message='Converting degaUsers to authors'
2019-04-01T22:24:57.124Z [DEGA-API] INFO: request_id=bcb68fcf-9586-586b-a6a7-b58086f47a5d controller=posts operation=getPosts message='Expanding sub-documents'
2019-04-01T22:24:57.208Z [DEGA-API] INFO: request_id=bcb68fcf-9586-586b-a6a7-b58086f47a5d controller=posts operation=getPosts url=/api/v1/posts/?client_id=factly-telugu&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=88 millis
2019-04-01T22:24:57.229Z [DEGA-API] INFO: request_id=10b2ad25-dec1-58d2-87d3-bd27902e64ca controller=factchecks operation=getFactcheck message='Converting degaUsers to authors'
2019-04-01T22:24:57.229Z [DEGA-API] INFO: request_id=10b2ad25-dec1-58d2-87d3-bd27902e64ca controller=factchecks operation=getFactcheck message='Expanding sub-documents'
2019-04-01T22:24:57.323Z [DEGA-API] DEBUG: request_id=10b2ad25-dec1-58d2-87d3-bd27902e64ca controller=factchecks operation=getFactcheck message='Ignoring factcheck 5c82539455a7540001fcb8ab - not published'
2019-04-01T22:24:57.344Z [DEGA-API] INFO: request_id=10b2ad25-dec1-58d2-87d3-bd27902e64ca controller=factchecks operation=getFactcheck url=/api/v1/factchecks/?client_id=factly-telugu&sortBy=lastUpdatedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.128.0.52 status=200 response_time=124 millis
Reference:
For factchecks
https://developers.google.com/search/docs/data-types/factcheck
https://schema.org/ClaimReview
For posts
https://developers.google.com/search/docs/data-types/article
https://schema.org/Article
For news article (need to plan on how to capture this data from publishing portal)
https://schema.org/NewsArticle
Remove the dependency on the node module: "logger": "^0.0.1" and replace the single file to within the code after fixing the issue.
Getting the following error after deploying API in production
Error: CSRF token missing
at checkCsrf (/app/node_modules/lusca/lib/csrf.js:151:18)
at /app/node_modules/lusca/index.js:59:28
at xframe (/app/node_modules/lusca/lib/xframes.js:12:9)
at /app/node_modules/lusca/index.js:59:28
at xssProtection (/app/node_modules/lusca/lib/xssprotection.js:16:9)
at /app/node_modules/lusca/index.js:59:28
at lusca (/app/node_modules/lusca/index.js:64:9)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
at /app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
at next (/app/node_modules/express/lib/router/index.js:275:10)
at session (/app/node_modules/express-session/index.js:454:7)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
at /app/node_modules/express/lib/router/index.js:284:7
We could use terminus as mentioned in expressjs documentation.
Got this error in Production today. I checked MongoDB and it was running just fine. Restarted all the dega-api pods and everything started working as expected. So, looks like it has to do with the dega-api service not able to connect to MongoDB once the service is resumed.
If MongoDB is down for some reason, will the dega-api continue to try to reconnect to it?
2019-06-11T12:56:47.011Z [DEGA-API] INFO: request_id=61e462abff95eca1ef7fa0cf850c2a95 controller=posts operation=getPosts clientId=factly-telugu message='Query Object {"client_id":"factly-telugu"}'
2019-06-11T12:56:47.013Z [DEGA-API] ERROR: request_id=61e462abff95eca1ef7fa0cf850c2a95 controller=posts operation=getPosts clientId=factly-telugu error_stack=MongoError: Topology was destroyed
at initializeCursor (/app/node_modules/mongodb-core/lib/cursor.js:596:25)
at nextFunction (/app/node_modules/mongodb-core/lib/cursor.js:456:12)
at Cursor.next (/app/node_modules/mongodb-core/lib/cursor.js:766:3)
at Cursor._next (/app/node_modules/mongodb/lib/cursor.js:216:36)
at fetchDocs (/app/node_modules/mongodb/lib/operations/cursor_ops.js:217:12)
at toArray (/app/node_modules/mongodb/lib/operations/cursor_ops.js:247:3)
at /app/node_modules/mongodb/lib/utils.js:433:24
at new Promise (<anonymous>)
at executeOperation (/app/node_modules/mongodb/lib/utils.js:428:10)
at Cursor.toArray (/app/node_modules/mongodb/lib/cursor.js:829:10)
at Object.module.exports [as find] (/app/node_modules/mongo-cursor-pagination/src/find.js:45:6)
at process._tickCallback (internal/process/next_tick.js:68:7) error_message=Topology was destroyed error_name=MongoError error_type=MongoError url=/api/v1/posts/?client=factly-telugu&category=video&sortBy=publishedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.64.2.6 status=500 response_time=3 millis
2019-06-11T12:56:47.203Z [DEGA-API] ERROR: request_id=42034ce70d5812c5722644c1b74019d4 controller=organizations operation=getOrganization clientId=factly-telugu error_stack=MongoError: Topology was destroyed
at initializeCursor (/app/node_modules/mongodb-core/lib/cursor.js:596:25)
at nextFunction (/app/node_modules/mongodb-core/lib/cursor.js:456:12)
at Cursor.next (/app/node_modules/mongodb-core/lib/cursor.js:766:3)
at Cursor._next (/app/node_modules/mongodb/lib/cursor.js:216:36)
at fetchDocs (/app/node_modules/mongodb/lib/operations/cursor_ops.js:217:12)
at toArray (/app/node_modules/mongodb/lib/operations/cursor_ops.js:247:3)
at /app/node_modules/mongodb/lib/utils.js:433:24
at new Promise (<anonymous>)
at executeOperation (/app/node_modules/mongodb/lib/utils.js:428:10)
at Cursor.toArray (/app/node_modules/mongodb/lib/cursor.js:829:10)
at OrganizationModel.getOrganization (/app/models/organization.js:23:26)
at getOrganization (/app/controllers/api/v1/organizations.js:9:18)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at next (/app/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) error_message=Topology was destroyed error_name=MongoError error_type=MongoError url=/api/v1/organizations/?client=factly-telugu method=GET env=development remote_ip=::ffff:10.64.2.6 status=500 response_time=1 millis
2019-06-11T12:56:56.710Z [DEGA-API] INFO: request_id=c3cae35de90697b3afb60471aa8cc936 controller=posts operation=getPosts clientId=factly-telugu message='Query Object {"client_id":"factly-telugu"}'
2019-06-11T12:56:56.714Z [DEGA-API] ERROR: request_id=c3cae35de90697b3afb60471aa8cc936 controller=posts operation=getPosts clientId=factly-telugu error_stack=MongoError: Topology was destroyed
at initializeCursor (/app/node_modules/mongodb-core/lib/cursor.js:596:25)
at nextFunction (/app/node_modules/mongodb-core/lib/cursor.js:456:12)
at Cursor.next (/app/node_modules/mongodb-core/lib/cursor.js:766:3)
at Cursor._next (/app/node_modules/mongodb/lib/cursor.js:216:36)
at fetchDocs (/app/node_modules/mongodb/lib/operations/cursor_ops.js:217:12)
at toArray (/app/node_modules/mongodb/lib/operations/cursor_ops.js:247:3)
at /app/node_modules/mongodb/lib/utils.js:433:24
at new Promise (<anonymous>)
at executeOperation (/app/node_modules/mongodb/lib/utils.js:428:10)
at Cursor.toArray (/app/node_modules/mongodb/lib/cursor.js:829:10)
at Object.module.exports [as find] (/app/node_modules/mongo-cursor-pagination/src/find.js:45:6)
at process._tickCallback (internal/process/next_tick.js:68:7) error_message=Topology was destroyed error_name=MongoError error_type=MongoError url=/api/v1/posts/?client=factly-telugu&category=video&sortBy=publishedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.64.2.6 status=500 response_time=5 millis
2019-06-11T12:56:56.911Z [DEGA-API] ERROR: request_id=449fe0b129ade53a42446c1c46add1aa controller=factchecks operation=getFactcheck clientId=factly-telugu error_stack=MongoError: Topology was destroyed
at initializeCursor (/app/node_modules/mongodb-core/lib/cursor.js:596:25)
at nextFunction (/app/node_modules/mongodb-core/lib/cursor.js:456:12)
at Cursor.next (/app/node_modules/mongodb-core/lib/cursor.js:766:3)
at Cursor._next (/app/node_modules/mongodb/lib/cursor.js:216:36)
at fetchDocs (/app/node_modules/mongodb/lib/operations/cursor_ops.js:217:12)
at toArray (/app/node_modules/mongodb/lib/operations/cursor_ops.js:247:3)
at /app/node_modules/mongodb/lib/utils.js:433:24
at new Promise (<anonymous>)
at executeOperation (/app/node_modules/mongodb/lib/utils.js:428:10)
at Cursor.toArray (/app/node_modules/mongodb/lib/cursor.js:829:10)
at FactcheckModel.getFactcheck (/app/models/factcheck.js:49:59)
at getFactcheck (/app/controllers/api/v1/factchecks.js:14:18)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at next (/app/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) error_message=Topology was destroyed error_name=MongoError error_type=MongoError url=/api/v1/factchecks/?client=factly-telugu&slug=2016-%E0%B0%B2%E0%B1%8B-%E0%B0%9C%E0%B0%97%E0%B0%A8%E0%B1%8D-%E0%B0%AA%E0%B1%8D%E0%B0%B0%E0%B0%A4%E0%B1%8D%E0%B0%AF%E0%B1%87%E0%B0%95-%E0%B0%B9%E0%B1%8B%E0%B0%A6%E0%B0%BE-%E0%B0%95%E0%B1%8B%E0%B0%B8%E0%B0%82-%E0%B0%9A%E0%B1%87%E0%B0%B8%E0%B0%BF%E0%B0%A8-%E0%B0%AA%E0%B1%82%E0%B0%9C-%E0%B0%B5%E0%B1%80%E0%B0%A1%E0%B0%BF%E0%B0%AF%E0%B1%8B-%E0%B0%A4%E0%B1%80%E0%B0%B8%E0%B1%81%E0%B0%95%E0%B1%8A%E0%B0%A8%E0%B0%BF-%E0%B0%A4%E0%B0%AA%E0%B1%8D%E0%B0%AA%E0%B1%81%E0%B0%97%E0%B0%BE-%E0%B0%AA%E0%B1%8D%E0%B0%B0%E0%B0%9A%E0%B0%BE%E0%B0%B0%E0%B0%82-%E0%B0%9A%E0%B1%87%E0%B0%B8%E0%B1%8D%E0%B0%A4%E0%B1%81%E0%B0%A8%E0%B1%8D%E0%B0%A8%E0%B0%BE%E0%B0%B0%E0%B1%81. method=GET env=development remote_ip=::ffff:10.64.2.6 status=500 response_time=2 millis
2019-06-11T12:56:57.128Z [DEGA-API] INFO: request_id=a173015f1c0d7207b815668550276a11 controller=posts operation=getPosts clientId=factly-telugu message='Query Object {"client_id":"factly-telugu"}'
2019-06-11T12:56:57.130Z [DEGA-API] ERROR: request_id=a173015f1c0d7207b815668550276a11 controller=posts operation=getPosts clientId=factly-telugu error_stack=MongoError: Topology was destroyed
at initializeCursor (/app/node_modules/mongodb-core/lib/cursor.js:596:25)
at nextFunction (/app/node_modules/mongodb-core/lib/cursor.js:456:12)
at Cursor.next (/app/node_modules/mongodb-core/lib/cursor.js:766:3)
at Cursor._next (/app/node_modules/mongodb/lib/cursor.js:216:36)
at fetchDocs (/app/node_modules/mongodb/lib/operations/cursor_ops.js:217:12)
at toArray (/app/node_modules/mongodb/lib/operations/cursor_ops.js:247:3)
at /app/node_modules/mongodb/lib/utils.js:433:24
at new Promise (<anonymous>)
at executeOperation (/app/node_modules/mongodb/lib/utils.js:428:10)
at Cursor.toArray (/app/node_modules/mongodb/lib/cursor.js:829:10)
at Object.module.exports [as find] (/app/node_modules/mongo-cursor-pagination/src/find.js:45:6)
at process._tickCallback (internal/process/next_tick.js:68:7) error_message=Topology was destroyed error_name=MongoError error_type=MongoError url=/api/v1/posts/?client=factly-telugu&category=video&sortBy=publishedDate&sortAsc=false method=GET env=development remote_ip=::ffff:10.64.2.6 status=500 response_time=3 millis
2019-06-11T12:56:57.528Z [DEGA-API] ERROR: request_id=32cbecae636cb6bffa1804a4f617334c controller=factchecks operation=getFactcheck clientId=factly-telugu error_stack=MongoError: Topology was destroyed
at initializeCursor (/app/node_modules/mongodb-core/lib/cursor.js:596:25)
at nextFunction (/app/node_modules/mongodb-core/lib/cursor.js:456:12)
at Cursor.next (/app/node_modules/mongodb-core/lib/cursor.js:766:3)
at Cursor._next (/app/node_modules/mongodb/lib/cursor.js:216:36)
at fetchDocs (/app/node_modules/mongodb/lib/operations/cursor_ops.js:217:12)
at toArray (/app/node_modules/mongodb/lib/operations/cursor_ops.js:247:3)
at /app/node_modules/mongodb/lib/utils.js:433:24
at new Promise (<anonymous>)
at executeOperation (/app/node_modules/mongodb/lib/utils.js:428:10)
at Cursor.toArray (/app/node_modules/mongodb/lib/cursor.js:829:10)
at FactcheckModel.getFactcheck (/app/models/factcheck.js:49:59)
at getFactcheck (/app/controllers/api/v1/factchecks.js:14:18)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at next (/app/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) error_message=Topology was destroyed error_name=MongoError error_type=MongoError url=/api/v1/factchecks/?client=factly-telugu&slug=2011-%E0%B0%A8%E0%B0%BE%E0%B0%9F%E0%B0%BF-%E0%B0%B5%E0%B1%88-%E0%B0%B8%E0%B1%8D-%E0%B0%9C%E0%B0%97%E0%B0%A8%E0%B1%8D-%E0%B0%AB%E0%B1%8B%E0%B0%9F%E0%B1%8B-%E0%B0%A8%E0%B0%BF-%E0%B0%AB%E0%B1%8B%E0%B0%9F%E0%B1%8B%E0%B0%B7%E0%B0%BE%E0%B0%AA%E0%B1%8D-%E0%B0%9A%E0%B1%87%E0%B0%B8%E0%B0%BF-%E0%B0%AE%E0%B0%A6%E0%B1%8D%E0%B0%AF%E0%B0%82-%E0%B0%AC%E0%B0%BE%E0%B0%9F%E0%B0%BF%E0%B0%B2%E0%B1%8D-%E0%B0%A4%E0%B1%8B-%E0%B0%87%E0%B0%AA%E0%B1%8D%E0%B0%AA%E0%B1%81%E0%B0%A1%E0%B1%81-%E0%B0%AA%E0%B1%8D%E0%B0%B0%E0%B0%9A%E0%B0%BE%E0%B0%B0%E0%B0%82-%E0%B0%9A%E0%B1%87%E0%B0%B8%E0%B1%8D%E0%B0%A4%E0%B1%81%E0%B0%A8%E0%B1%8D%E0%B0%A8%E0%B0%BE%E0%B0%B0%E0%B1%81 method=GET env=development remote_ip=::ffff:10.64.2.6 status=500 response_time=2 millis
2019-06-11T12:56:57.707Z [DEGA-API] ERROR: request_id=4988836a0b33e325f103d4fe0e09eca5 controller=organizations operation=getOrganization clientId=factly-telugu error_stack=MongoError: Topology was destroyed
at initializeCursor (/app/node_modules/mongodb-core/lib/cursor.js:596:25)
at nextFunction (/app/node_modules/mongodb-core/lib/cursor.js:456:12)
at Cursor.next (/app/node_modules/mongodb-core/lib/cursor.js:766:3)
at Cursor._next (/app/node_modules/mongodb/lib/cursor.js:216:36)
at fetchDocs (/app/node_modules/mongodb/lib/operations/cursor_ops.js:217:12)
at toArray (/app/node_modules/mongodb/lib/operations/cursor_ops.js:247:3)
at /app/node_modules/mongodb/lib/utils.js:433:24
at new Promise (<anonymous>)
at executeOperation (/app/node_modules/mongodb/lib/utils.js:428:10)
at Cursor.toArray (/app/node_modules/mongodb/lib/cursor.js:829:10)
at OrganizationModel.getOrganization (/app/models/organization.js:23:26)
at getOrganization (/app/controllers/api/v1/organizations.js:9:18)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at next (/app/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) error_message=Topology was destroyed error_name=MongoError error_type=MongoError url=/api/v1/organizations/?client=factly-telugu method=GET env=development remote_ip=::ffff:10.64.2.6 status=500 response_time=2 millis
Dynamically populate the following elements for factcheck schema:
Reference: https://developers.google.com/search/docs/data-types/factcheck
Dependent on: factly/dega-factcheck#26
Discussed with @monarkatfactly about the same.
Currently for the list pages (homepage, category, tag, author pages etc) we make API calls to get posts and factchecks which gets all the post, factcheck data from the API that includes a lot of information that is not required. We will use a very small set of this information on the list pages, making it very inefficient to use. To increase the performance of these list pages, especially the homepage we should probably look into implementing GraphQL/JSON API for posts and factchecks where the caller can request the parameters that they require.
Here is a good comparison of REST API vs JSON API vs GraphQL: https://dri.es/headless-cms-rest-vs-jsonapi-vs-graphql
This is what Drupal Project lead had to suggest: Based on this analysis, for Drupal core's needs, we rank JSON:API above GraphQL and GraphQL above REST. As such, I want to change my recommendation for Drupal 8 core. Instead of adding both JSON:API and GraphQL to Drupal 8 core, I believe only JSON:API should be added. That said, Drupal's GraphQL implementation is fantastic, especially when you have the developer capacity to build a bespoke API for your project.
The same applies for us being a CMS as well. We should do the same too and spend efforts on JSON API instead of GraphQL.
copying MongoDB to a local db
client_id is part of the organization entity within dega user. currently when we query for users for a client, we are not getting any results since we are not looping through the organizations to filter for client id but are only filtering at the parent level.
Need to implement in the following lines like mentioned in the article: https://developers.google.com/search/docs/data-types/factcheck
Create a single page with multiple full-length reviews, each with an HTML anchor. Each ClaimReview element points to that summary_page.html#anchor
Running into CORS errors when invoking the API from dega-web. Linked pages on the website doesn't work and having to reload the page every single time as a work round for development.
I noticed that the issue is with setting up SSL for the api.
This seems like a popular library to use:
https://www.npmjs.com/package/sitemap
https://github.com/ekalinin/sitemap.js
I am not sure if this should be a part of API or if it should be part of the Web. I would prefer this to be in the API, so this would be reusable.
In any case, Nuxt seems to have a sitemap implementation based on the same node package as well:
https://www.npmjs.com/package/@nuxtjs/sitemap
https://github.com/nuxt-community/sitemap-module
Look at the changes from PR
https://github.com/factly/dega-api/pull/12
Create documentation for the following entities:
Entities to filter:
Stories are not getting sorted in the right order on the basis of Published Date
Create functional tests for the following entities:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.