{"id":28836365,"url":"https://github.com/babylonjs/snippetserverexpress","last_synced_at":"2025-09-13T16:57:37.778Z","repository":{"id":238887195,"uuid":"776102841","full_name":"BabylonJS/SnippetServerExpress","owner":"BabylonJS","description":"An Express.js implementation of our snippet server, capable of file system, in memory and azure blob storage deployment","archived":false,"fork":false,"pushed_at":"2025-04-01T13:16:20.000Z","size":217,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-01T14:27:44.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BabylonJS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-22T17:28:55.000Z","updated_at":"2025-04-01T13:16:23.000Z","dependencies_parsed_at":"2024-05-08T18:05:49.940Z","dependency_job_id":"de979918-b03f-41f7-9467-80ed4c973d2b","html_url":"https://github.com/BabylonJS/SnippetServerExpress","commit_stats":null,"previous_names":["babylonjs/snippetserverexpress"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BabylonJS/SnippetServerExpress","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BabylonJS%2FSnippetServerExpress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BabylonJS%2FSnippetServerExpress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BabylonJS%2FSnippetServerExpress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BabylonJS%2FSnippetServerExpress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BabylonJS","download_url":"https://codeload.github.com/BabylonJS/SnippetServerExpress/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BabylonJS%2FSnippetServerExpress/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260739028,"owners_count":23055071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-19T11:05:08.839Z","updated_at":"2025-09-13T16:57:37.763Z","avatar_url":"https://github.com/BabylonJS.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Babylon.js Snippet Server\n\nThis is the implementation used by Babylon’s snippet server. It is an Express.js implementation written in TypeScript.\n\n## Why is it needed?\n\nBabylon allows you, as a developer, to replace the snippet server that is used in your implementation. For example, if you want to deploy your own version of the NME, NGE, Playground, or the GUI Editor, you can change the snippet base URL. Using this implementation, you will be able to deploy your own version of the snippet server and keep your snippets out of the public snippet repository.\n\nSo, if you:\n\n- Don’t want others to find your playground snippets\n- Want to keep your code snippets secure and internal\n- Prefer not to depend on Babylon’s infrastructure\n\nthis implementation is for you! 😊\n\n## How to prepare\n\n## Configuration\n\nAll configuration elements are read from the environment variables. DotEnv is integrated in the repository, so adding a .env file in the main directory will allow you to define those environment variables when running the server from the repository.\n\nThe application will work without a .env using the default values.\n\nThese are the environment variables supported (and their default values, if defined):\n\n```yaml\nPORT=3000 ## The port number to use when starting the server\nSTORAGE_TYPE=fileSystem ## The default data layer\nCREATE_DATA_LAYERS ## If provided, this comma-separated value will register these as the create layer(s). For example: \"inMemory,fileSystem\"\nGET_DATA_LAYERS ## If provided, this comma-separated value will register these as the getter layer(s). For example: \"inMemory\"\nFILE_SYSTEM_DIRECTORY=\"./data\" ## if using file system, where should the snippets be saved.\nAZURE_STORAGE_ACCOUNT_NAME ## The azure storage account name\nAZURE_STORAGE_CONTAINER_NAME=snippets ## the name of the container in the blob storage\nAZURE_STORAGE_ACCOUNT_KEY ## the key to use to log in to the azure storage account\nAZURE_SEARCH_INDEX_KEY ## search index key\nAZURE_SEARCH_INDEX_SERVICE_NAME ## search index searvice name\nAZURE_SEARCH_INDEX_INDEX_NAME=\"snippets\" ## name of the search index\nJSON_SIZE_LIMIT=\"5mb\" ## the limit put on JSON provided by the users\nUPDATE_KEY ## an optional update key to allow updating a version instead of saving a new one\nMAX_SNIPPET_SEARCH_INDEX_SIZE ## The maximum size of snippet that will be sent to the search index\nCORS_ORIGINS=\"*\" ## comma-separated domains for CORS. For example: \"https://is.babylonjs.com,https://not.babylonjs.com\"\n```\n\n### Data layers\n\nYou will first need to decide which data layer(s) you want to use. We currently implement the following:\n\n- (inMemory) In-Memory data layer - will save your snippets in-memory, for as long as the server is running and will lose all content if the server stops.\n- (fileSystem) File system data layer - keep the snippet on the local file system. Running the server in the same place will allow serving these snippets again.\n- (azureBlob) Azure Blob storage data layer - store the snippets in an azure blob storage (think - cloud-based file system).\n- (azureSearch) Azure search index data layer - filters and stores the snippet in a searchi index. Note that this implementation is very much targeted towards Babylon's needs.\n\nThe last 2 are used in our snippet server.\n\n## Run the server\n\n- Run `npm install`\n- Run `npm start` to start the server or `npm run watch` to run the server in watch mode\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabylonjs%2Fsnippetserverexpress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbabylonjs%2Fsnippetserverexpress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabylonjs%2Fsnippetserverexpress/lists"}