-
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.
- Loading branch information
Showing
10 changed files
with
56 additions
and
134 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20.15.0 |
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 @@ | ||
20.15.0 |
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,21 @@ | ||
const BUNDLE_ID = process.env.BUNDLE_ID; | ||
|
||
if (!BUNDLE_ID) { | ||
console.error("BUNDLE_ID must be present in the environment"); | ||
process.exit(1); | ||
} | ||
|
||
console.log(`Downloading bundle: ${BUNDLE_ID}`); | ||
|
||
const url = `http://0.0.0.0:5558/files/${BUNDLE_ID}`; | ||
|
||
const response = await fetch(url); | ||
|
||
if (!response.ok) { | ||
console.error(`Failed to download bundle. Status code: ${response.status}`); | ||
process.exit(1); | ||
} | ||
|
||
const text = await response.text(); | ||
|
||
console.log(`Downloaded bundle with content: ${text}`); |
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
{ | ||
"name": "xmtp-message-history-server-example", | ||
"version": "0.0.0", | ||
"private": true, | ||
"type": "module" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
Hello, world! |
This file was deleted.
Oops, something went wrong.
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,26 @@ | ||
import { readFileSync } from "node:fs"; | ||
import { join } from "node:path"; | ||
|
||
const file = readFileSync(join(import.meta.dirname, "test_file.txt"), { | ||
encoding: "utf-8", | ||
}); | ||
|
||
console.log(`Uploading file test_file.txt with content: ${file}`); | ||
|
||
const response = await fetch("http://0.0.0.0:5558/upload", { | ||
method: "POST", | ||
body: file, | ||
}); | ||
|
||
if (response.ok) { | ||
console.log("File uploaded successfully"); | ||
} else { | ||
console.error(`Failed to upload file. Status code: ${response.status}`); | ||
process.exit(1); | ||
} | ||
|
||
const bundleId = await response.text(); | ||
console.log(`Bundle ID: ${bundleId}`); | ||
console.log( | ||
`Run "BUNDLE_ID=${bundleId} node download.js" to download the file` | ||
); |