can neo4j be used with RailwayJS - orm

I'm having trouble using neo4j as my backing database to a RailwayJS starter project. I updated the database.json file to point my local neo4j instance but it seems to just hang when I call any route with data access.
Here's what's in my database.json file
{
"development":
{ "driver": "neo4j" , "url": "http://localhost:7474/"}
, "test":
{ "driver": "memory"
}
}
Does RailwayJS support neo4j? Is there something I need to configure it to work?

Dunno about RailwayJS, but there is a driver for Node.js, see https://github.com/thingdom/node-neo4j/
Would love to see some blog or so when you get it working!

Related

Reverse proxy for bazel + angular project

I am running an angular build using Bazel, and need a reverse proxy to change the host and port of my backend. Normally I would create a serve-command in angular.json, which implements the builder #angular-devkit/build-angular:dev-server with a proxy setup:
"serve": {
"builder": "#angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "MyPackage:build",
"proxyConfig": "proxy.conf.json"
},
"configurations": {
"production": {
"browserTarget": "MyPackage:build:production"
}
}
}
But since I'm using Bazel, I'm using another builder, the #bazel/angular:build. Unfortunately this builder does not support my proxy configuration, where I would use something like:
{
"/apps": {
"target": "https://my.server:8080",
"secure": true,
"changeOrigin": true
}
}
Is there an alternative to this?
You have probably already seen this page, but I'll link it for reference:
https://bazelbuild.github.io/rules_nodejs/examples#angular
In the "Architect" approach, you build with Bazel but run the standard Angular builders. So if you just want a quick way to keep the functionality, but plug the project into Bazel, I would recommend it.
The #bazel/angular:build builder is part of the "Google" approach described on that page. While it's fast and more "Bazel-native" it also uses a different toolchain. Most notably, no webpack.
The linked example uses concatjs_devserver:
https://github.com/bazelbuild/rules_nodejs/blob/stable/examples/angular/src/BUILD.bazel#L111
which sadly doesn't have a proxy feature.
You can either fall back to the "Architect" approach or write your own Bazel rule that starts a different devserver. Yet another approach would be to just run some reverse proxy in front of both the devserver and your backend server.

Azure FHIR search for resources with _include

I have a DiagnosticReport resouce that has an encounter and 3 observation resources references. I am trying to do a search query that would return a Bundle with the DiagnosticReport and all referenced resources so as to not have to do 4 other queries.
"encounter": {
"reference": "Encounter/8720d7d7-68cc-3575-8c79-9de39561324c"
},
"effectivePeriod": {
"start": "2020-07-01T08:16:00.000Z",
"end": "2020-07-01T08:16:00.000Z"
},
"issued": "2020-07-01T08:17:03+00:00",
"result": [
{
"reference": "Observation/89510c61-8a94-3c65-8832-3397d2a70bfd"
},
{
"reference": "Observation/3d837dbf-3d4c-3742-9b6e-2638d26d8c54"
},
{
"reference": "Observation/618ec246-2d98-3179-a0a2-a0094046f466"
}
]
I have tried
[Base]/DiagnosticReport/{id}?_include=DiagnosticReport:Encounter
[Base]/DiagnosticReport/{id}?_include=DiagnosticReport:Encounter/{id}
Is there a way to get the DiagnosticReport & Encoutner & Observation in one Bundle?
This is an SQL OSS FHIR Server, so according to Documentation _include is supported in the SQL Version of azure.
You need to use the search parameters when you specify the includes, so in your case:
https://fhir-server-url/DiagnosticReport?_id=1234&_include=DiagnosticReport:encounter&_include=DiagnosticReport:result
Will return the Encounter and the Observation resources in the bundle.
I'm using FHIR API Service also. I ran across this issue for Encounter and this worked for me.
https://lcavantage.azurehealthcareapis.com/Encounter?_id=f1c06cc6-be9c-e673-408e-e6e303d9924a&_include=Encounter:subject
I believe this works now because COSMOS DB has had a few updates this question was presented and handles relationships better!

Can I have multiple outputs in an OpenShift Origin build?

I'm building several base images for our infrastructure and would like to mimic the Docker Hub nomenclature for the image tags. For example, Java image on Docker Hub includes several aliases for the same image, e.g. 8 and latest is the same image.
If I were to replicate this system in ImageStreams, I would need to create a BuildConfig with an output specification like this:
"output": {
"to": {
"kind": "ImageStreamTag"
"name": "jdk:8"
}
}
Obviously, this only includes one tag, so even if I were to write
"output": {
"to": {
"kind": "ImageStreamTag"
"name": "jdk:8"
},
"to": {
"kind": "ImageStreamTag"
"name": "jdk:latest"
}
}
only the latest definition would actually be executed.
Is there any proper way to push the same image into different tags apart from creating a different BuildConfig (which would probably "build" from Docker image to Docker image)?
There is a card on the trello board to do this: https://trello.com/c/nOX8FTRq/686-5-support-multiple-tags-for-a-build-output .
You should also be able to do this using oc tag to avoid having to run the same build twice.

can't seem to get static route with kraken.js

I'm trying to upgrade an existing express site to use kraken.js
I've got my dynamic pages loading ok (so far), but I can't seem to serve static files.
Looking at the example, pages, it seems simple enough that I just have to add
"middleware": {
"static": {
"arguments": [ "path: ./client" ]
}
}
In my config.json file. The file I'm trying to serve is ./client/build/js/bundle.js, and I can confirm that the file exists in the folder. It is NOT in a ./public folder.
What do I need to do to get kraken (or kraken.js static-serve) to find my static files?
I've placed the file in a ./public/client/build/js/bundle.js and kraken has no problem finding the file in that location.
I think you might be missing the "module" member of the middleware object. My current Kraken-generated static middleware config object looks like this:
"static": {
"module": {
"arguments": [ "path:./.build" ]
}
}
OK, I found out how to make it work. Notice how in your config that "public" isn't in there? That meant it was being pre-pended or configured somewhere else. That somewhere else is in /node-modules/kraken-js/config/config.json. I amended it to look like this:
"static": {
"enabled": true,
"priority": 40,
"module": {
"name": "serve-static",
"arguments": [ "path:./public", "path:./client" ]
}
},
Then in your regular /config/config.json I edited the static object to look like this:
"static": {
"module": {
"arguments": [ "path:./.build", "path:./build" ]
}
},
Notice that in the second argument there is not a "." before build.
Finally, I used script tags that looked like this in the master layout:
<script src="/js/test.js"></script>
So, from your root project directory I have /client/build/js/test.js and test.js loads correctly.
Also, there is one more way to do it that is easier and doesn't require mucking about in the kraken source. In your main index.js file you can do this:
app = module.exports = express();
app.use(kraken(options));
app.use(express.static('client')); // Add this line
Days, then weeks, then months went by, and nothing worked.
I should have noted that I am not using Yoeman, and we use gulp at work, which may have been part of the problem.
The solution turned out to be
"middleware": {
"static": {
"route": "/public"
},
which looks very different to any of the documentation from kraken. Hope this helps somebody.

Create different versions form one bootstrap file with require.js

I develop an iPad/iPhone App web app. Both share some of the resources. Now I wanna build a bootstrap js that looks like this:
requirejs(['app'], function(app) {
app.start();
});
The app resource should be ipadApp.js or iphoneApp.js. So I create the following build file for the optimizer:
{
"appDir": "../develop",
"baseUrl": "./javascripts",
"dir": "../public",
"modules": [
{
"name": "bootstrap",
"out": "bootstrap-ipad.js",
"override": {
"paths": {
"app": "ipadApp"
}
}
},
{
"name": "bootstrap",
"out": "bootstrap-iphone.js",
"override": {
"paths": {
"app": "iphoneApp"
}
}
}
]
}
But this doesn't seems to work. It works with just one module but not with the same module with different outputs.
The only other solution that came in my mind was 4 build files which seems a bit odd. So is there a solution where i only need one build file?
AFAIK the r.js optimizer can only output a module with a given name once - in your case you are attempting to generate the module named bootstrap twice. The author of require.js, #jrburke made the following comment on a related issue here:
...right now you would need to generate a separate build command for each script being targeted, since the name property would always be "almond.js" for each one.
He also suggests:
...if you wanted just one build file to run, you could create a node program and drive the optimizer multiple times in one script file. This example shows using requirejs as a module and calling requirejs.optimize().
I took a similar approach in one of my projects - I made my build.js file an ERB template and created a Thor task that ran through my modules and ran r.js once for each one. But #jrburke's solution using node.js is cleaner.