{"id":16477225,"url":"https://github.com/isubasinghe/snippets-backend","last_synced_at":"2026-02-17T23:02:12.332Z","repository":{"id":43873363,"uuid":"209689202","full_name":"isubasinghe/snippets-backend","owner":"isubasinghe","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-10T06:20:53.000Z","size":2258,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-23T04:42:56.803Z","etag":null,"topics":["code","faas","simple","snippets"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isubasinghe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-20T02:34:06.000Z","updated_at":"2020-12-23T01:14:09.000Z","dependencies_parsed_at":"2023-01-25T22:30:39.526Z","dependency_job_id":null,"html_url":"https://github.com/isubasinghe/snippets-backend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/isubasinghe/snippets-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isubasinghe%2Fsnippets-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isubasinghe%2Fsnippets-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isubasinghe%2Fsnippets-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isubasinghe%2Fsnippets-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isubasinghe","download_url":"https://codeload.github.com/isubasinghe/snippets-backend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isubasinghe%2Fsnippets-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29561783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T21:50:49.831Z","status":"ssl_error","status_checked_at":"2026-02-17T21:46:15.313Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["code","faas","simple","snippets"],"created_at":"2024-10-11T12:45:03.263Z","updated_at":"2026-02-17T23:02:12.311Z","avatar_url":"https://github.com/isubasinghe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is this project\n\nIts an insecure FaaS essentially, you can host your random snippets of code on here.  \nJust make sure that it isnt security critical code.  \nI have some security going on however, I have only allowed the http and net modules on here. Please let me know if other modules are required, I can write mock interfaces for fs if needed.\n\n## Creating a function\n\nSubmit a POST request to http(s)://host/api/create that follows the JSON spec below\n\n```javascript\n{\n    \"source\" \"This is where a string representation of your source code should go, this source code MUST contain a module.exports to a fucntion that has two parameters, req: the express js request object and cb: the callback to return after execution of code.\"\n}\n```\nHere is an example\n```javascript\n{\n\t\"source\": \"module.exports = function(req, callback) { callback({data: 'hello' }); }\"\n}\n```\nThis will return a json in this format\n```javascript\n{\n  \"message\": \"Created function {sha256_hash_of_source_code_after_beautify}\"\n}\n```\nan example for sha256_hash_of_source_code_after_beautify = 00867e8f59188a3a6081f538a8acd9246b3250df7bf56cce211fa2cb27bdc610 is\n```javascript\n{\n  \"message\": \"Created function 00867e8f59188a3a6081f538a8acd9246b3250df7bf56cce211fa2cb27bdc610\"\n}\n```\n\n## Testing a function\nPerform any http request to the endpoint http(s)://host/:sourceHash  \nThe req body from the server itself is passed onto the sanboxed function.  \nFor the above example we could do a GET to http(s)://host/00867e8f59188a3a6081f538a8acd9246b3250df7bf56cce211fa2cb27bdc610","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisubasinghe%2Fsnippets-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisubasinghe%2Fsnippets-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisubasinghe%2Fsnippets-backend/lists"}