-
Notifications
You must be signed in to change notification settings - Fork 5
feat: update nodejs getting started guide #275
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
Merged
+38
−39
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,58 +1,57 @@ | ||
| # Node Quickstart | ||
|
|
||
| This project is a simple web application that demonstrates how to upload files | ||
| to a Tigris storage bucket and manage them. It is a web server using Express | ||
| that serves up a single web page, preconfigured to deploy to Fly.io. | ||
|
|
||
| All of the code in index.mjs is heavily commented to better help you understand | ||
| what each section is doing. | ||
| This project is a simple web application that demonstrates how to upload objects | ||
| to a Tigris storage bucket and manage them. It's built using Next.js router and | ||
| includes implementation of both apis and client. | ||
|
|
||
|  | ||
|
|
||
| ## How to deploy this project | ||
|
|
||
| This project is designed to be easily deployed to Fly.io. | ||
|
|
||
| Before you get started, make sure you have a [Fly.io](https://fly.io/) account | ||
| and the [fly CLI](https://fly.io/docs/flyctl/install/) installed on your | ||
| computer. | ||
|
|
||
| Start by cloning the project to your computer: | ||
|
|
||
| ```bash | ||
| git clone https://github.com/tigrisdata-community/tigris-node-quickstart.git | ||
| git clone https://github.com/tigrisdata-community/storage-sdk-examples | ||
| ``` | ||
|
|
||
| Open the repository in the editor of your choice. Since all applications on Fly | ||
| need to be globally unique, change the value of app in the fly.toml file before | ||
| attempting to deploy: | ||
| ## Running project locally | ||
|
|
||
| ```toml | ||
| # ... | ||
| app = 'tigris-node-quickstart' # Update this | ||
| # ... | ||
| ``` | ||
| 1. **Install dependencies:** | ||
|
|
||
| Once updated, run the following command to configure the app in your Fly | ||
| account, accepting the defaults when prompted: | ||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| ```bash | ||
| fly launch | ||
| ``` | ||
| 2. **Configure environment variables:** Copy `.env.example` to `.env` and update | ||
| with your Tigris credentials: | ||
|
|
||
| Take note of the URL to access your app: | ||
| ```bash | ||
| TIGRIS_STORAGE_ACCESS_KEY_ID=your-tigris-key-id | ||
| TIGRIS_STORAGE_SECRET_ACCESS_KEY=your-tigris-access-key | ||
| TIGRIS_STORAGE_BUCKET=your-bucket-name | ||
| ``` | ||
|
|
||
| ```bash | ||
| Visit your newly deployed app at https://{APP_NAME}.fly.dev/ | ||
| ``` | ||
| 3. **Run the development server:** | ||
|
|
||
| Before you can access the app, you'll need to configure the Tigris storage | ||
| bucket. Run the following command to create the bucket and set the necessary | ||
| environment variables on your Fly app. Accept the defaults when prompted. | ||
| ```bash | ||
| npm run dev | ||
| ``` | ||
|
|
||
| ```bash | ||
| fly storage create | ||
| 4. **Open your browser:** Navigate to | ||
| [http://localhost:3000](http://localhost:3000) | ||
|
|
||
| ## How to deploy this project | ||
|
|
||
| This project is designed to be easily deployed to Vercel. | ||
|
|
||
| To deploy on Vercel: | ||
|
|
||
| 1. Push the updated code to your GitHub/GitLab | ||
| 2. Import project in Vercel dashboard | ||
| 3. Add environment variables in Vercel settings: | ||
|
|
||
| ```env | ||
| - TIGRIS_STORAGE_ACCESS_KEY_ID | ||
| - TIGRIS_STORAGE_SECRET_ACCESS_KEY | ||
| - TIGRIS_STORAGE_BUCKET | ||
| ``` | ||
|
|
||
| Now navigate to the URL from the previous step and you should be presented with | ||
| the app. | ||
| 4. Deploy! | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.