-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: updated health check endpoints
- Loading branch information
Showing
5 changed files
with
1,140 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env node | ||
|
||
const yargs = require("yargs"); | ||
const loader = require("nmr-load-save"); | ||
const fileUtils = require("filelist-utils"); | ||
|
||
const options = yargs | ||
.usage("Usage: -u <url>") | ||
.option("u", { alias: "url", describe: "File URL", type: "string", demandOption: true }) | ||
.argv; | ||
|
||
async function loadSpectrum(url) { | ||
const {pathname:relativePath,origin:baseURL} = new URL(url); | ||
const source = { | ||
entries: [ | ||
{ | ||
relativePath, | ||
} | ||
], | ||
baseURL | ||
}; | ||
const fileCollection = await fileUtils.fileCollectionFromWebSource(source,{}); | ||
|
||
const { | ||
nmriumState: { data }, | ||
} = await loader.read(fileCollection); | ||
return data; | ||
} | ||
|
||
|
||
|
||
const url = options.u.split(" "); | ||
|
||
|
||
loadSpectrum(options.u).then((result)=>{ | ||
console.log(JSON.stringify(result)) | ||
}) | ||
|
||
|
Oops, something went wrong.