-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add an example for Node.js #252
base: main
Are you sure you want to change the base?
Conversation
This example is based off the FastAPI example.
The goal of the |
Posting a message on Aleph and handling HTTP Post requests are two different things, we should keep them separate in order to test and diagnose better. |
How should we build and package this application in the CI ? |
Not reviewed at all, this was a spam comment by a spam account @NostalgicGareth. He goes and spam a lot of projects like this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to submit this review 🫣
}) | ||
}) | ||
|
||
app.get('/env', (_req, res) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add docstrings or comments to explain what each function is doing ?
app.get('/raise', () => { | ||
try { | ||
throw new Error('This error was raised on purpose') | ||
} catch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the error catched ?
try { | ||
console.time('Fetching message') | ||
const posts = await post.Get({ | ||
APIServer: "https://api2.aleph.im", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API server is passed as environment variable to the VM, and the SDK should use that value by default.
|
||
addToReqStatus(data.error) | ||
}) | ||
</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use this page in the Python example as well ?
Can we get confirmation that this still works as intended? We talked about how we should support more languages/frameworks in the VMs and also to improve examples/docs for deploying these. Merging this PR should help with that. |
This example is based off the FastAPI example with some differences:
state
example is using an ephemeral keypair (used to send message) instead of a counter