-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] Prevent js file use from server configuration object #212
Comments
Ahryman40k
added a commit
to Ahryman40k/node-fhir-server-core
that referenced
this issue
Nov 28, 2019
server configuration allow to set custom metadata. Metadata is loaded from a path and we aim to use object instead Closes bluehalo#212
Ahryman40k
added a commit
to Ahryman40k/node-fhir-server-core
that referenced
this issue
Nov 28, 2019
Update custom metadata documentation file with a new chapter. Closes bluehalo#212
Ahryman40k
changed the title
[feat] Prevent js file loading from server configuration object
[feat] Prevent js file use from server configuration object
Nov 29, 2019
It is very useful, mostly when it is used inside a TypeScript project! |
See #213 (comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I would like to propose a new feature to the node-fhir-server-core.
Documentation describe how a config object should be constructed and provided to asymmetrik server initialization
As we are using typescript, providing a Javascript file path can be a difficult task, mainly in tests where code isn't transpiled.
So I would like to provide improvements regarding the configuration object.
Because I were doing experiments with configuration, I saw an error was thrown when 'service' path in configuration object is empty. Exception occurs in method 'verifyAndLoadProfiles' from 'server.js' file. With the following code:
I noticed that if type of 'service' isn't a string then object is stored in serviceModule property instead of loading a module from its path.
Because metadata isn't a required property the same mechanism doesn't happen during the validation process.
So I was wondering if the same behaviour exists for 'metadata' property.
In the file params.utils.js, method 'getSearchParameters' load our metadata module from the provided path. We can see these few lines of code:
Provided metadata module is loaded from its path then call the 'makeResource' method.
So If I understood clearly the logic here, I could test type of 'customArgsModule' then load module if it's a path else simply use object ? I mean something like:
Do you agree with my analysis ?
Are you ok to add surch feature ? If so can I create a Pull request ?
Best regards,
Ahry
The text was updated successfully, but these errors were encountered: