Changes in pathway-commons module (pc) and where it's used.#948
Changes in pathway-commons module (pc) and where it's used.#948IgorRodchenkov merged 8 commits intodevelopmentfrom
Conversation
# Conflicts: # package-lock.json
|
|
||
| //Pathway Commons HTTP GET request; options.cmd = 'get', 'search', 'traverse', 'graph', etc. | ||
| //Pathway Commons HTTP GET request; options.cmd = 'pc2/get', 'pc2/search', 'pc2/traverse', 'pc2/graph', etc. | ||
| const query = async (queryObj) => { |
There was a problem hiding this comment.
Is it possible to remove any mention of 'pc2' especially in the client (e.g. ServerAPI.pcQuery('pc2/get',) in favour of appending the 'pc2' here? This would require a change to router for '/pc2/:path' to use query
| router.get('/:path', function (req, res) { | ||
| res.redirect(config.PC_URL + req.params.path + '?' + qs.stringify(req.query)); | ||
| router.get('/pc2/:path', function (req, res) { | ||
| res.redirect(config.PC_URL + 'pc2/' + req.params.path + '?' + qs.stringify(req.query)); |
There was a problem hiding this comment.
This might be looking for the 'pc2' stripping it, then adding back?. Also could this just point to pc.query method?
There was a problem hiding this comment.
initially, router.get('/:path', function (req, res) - was to match/route ALL other possible direct requests to PC2 - mainly (or only) for the GSEA/SIF/SBGN/.. download links in the view's right-side panel.
I just had to made this change after changes in pc (server/pathway-commons) module, which redefined what 'cmd' (command) means - now it means full context path, such as pc2/search or sifgraph/v1/pathsbetween
|
Try and see it for yourself. It’s not obvious that app-ui calls to download raw data from PC2 work somewhat differently from other pc requests...
Try, try, try... What I’ve done in this PR doesn’t break the app; further and deeper refactoring and redesign is another matter, which wasn’t my intention this time.
IR
… On Jul 31, 2018, at 2:55 PM, Jeffrey ***@***.***> wrote:
@jvwong commented on this pull request.
In src/server/routes/pc.js:
> });
//this is mainly to download and save raw data (with correct content-time) from PC ws directly to client
-router.get('/:path', function (req, res) {
- res.redirect(config.PC_URL + req.params.path + '?' + qs.stringify(req.query));
+router.get('/pc2/:path', function (req, res) {
+ res.redirect(config.PC_URL + 'pc2/' + req.params.path + '?' + qs.stringify(req.query));
This might be looking for the 'pc2' stripping it, then adding back?. Also could this just point to pc.query method?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
I believe the interaction graph call to pc.query in /src/server/graph-generation/interaction/index.js needs the 'pc2' added . |
|
Yes, let me add that (but I think that index.js will be soon refactored via the other pool request - switching to Sifgraph - right?) |
|
Merged. Let me keep igor_pc branch (please don't delete) for future work. |
|
Alright, I can live without igor_pc branch :)) |
Refs #916, #938.
PC_URL now must point to the root PC URL (domain or ip:port), such as 'http://www.pathwaycommons.org/' or 'http://beta.pathwaycommons.org/' (tailing slash is required).
This allows app-ui code to query PC using "commands" (request paths) like 'pc2/search' instead 'search', and - now - 'sifgraph/v1/neighborhood', etc. (other/future PC services).