Align examples with the developer guide series#5
Merged
Conversation
- Add upload-and-download example folder (new, was missing) - Add .env.example to all example folders - Update .gitignore to exclude .env in filesystem, routing, routing-manifest, multi-author-blog - Add npm run scripts to dynamic-content and multi-author-blog - Add website package.json and .gitignore Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move website static files into site/ subdirectory so UPLOAD_DIR is unambiguous - Remove dotenv import from utils/upload-site.js (was breaking ESM resolution since utils/ has no node_modules); callers now own dotenv.config() - Add dotenv.config() to website/upload.js and routing/upload.js - Add dotenv dep, "type": "module", and upload npm script to routing/package.json - Remove dead PUBLISHER_KEY from routing/.env.example and routing-manifest/.env.example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add or refresh README.md in each example folder so anyone landing on the folder via GitHub gets a one-screen orientation and a link back to the corresponding guide on docs.ethswarm.org. Covers upload-and-download, filesystem, routing, routing-manifest, dynamic-content, simple-blog, multi-author-blog, and the existing website example.
Merged
6 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Aligns the example projects with the 7-guide developer series on docs.ethswarm.org so each guide has a complete, runnable companion project.
upload-and-download/example — the first guide previously had no companion code (two scripts: single file, and directory upload/download by path).env.examplein every folder +.gitignoreupdated to exclude.env, establishing a consistent setup patternwebsite/restructure — static files moved intosite/soUPLOAD_DIRhas an unambiguous target; addedpackage.jsonand upload scriptutils/upload-site.jsno longer importsdotenvdirectly (broke ESM resolution sinceutils/has nonode_modules); callers now owndotenv.config(). Addeddotenvdep,"type": "module", and anuploadscript torouting/package.jsondynamic-contentandmulti-author-blogPUBLISHER_KEYfromroutingandrouting-manifest.env.exampleTest plan
All examples were run end-to-end against a local Bee node with a funded batch:
upload-and-download— both scriptsfilesystem— all three scripts (manifest references match the guide)routing—npm run build+npm run upload, verified/#/aboutand 404 handlingrouting-manifest— upload → updateManifest → removeAndAddRoutes, verified/aboutand/moved-aboutresolutiondynamic-content— all three scriptssimple-blog— init → post create → readmulti-author-blog— init → add-post (alice, bob) → update-index → read → add-authorwebsite— upload, verified site served via feed manifest