{"id":20248831,"url":"https://github.com/webeetle/wetalk-fastify","last_synced_at":"2026-06-05T04:31:45.059Z","repository":{"id":40578979,"uuid":"252093384","full_name":"webeetle/wetalk-fastify","owner":"webeetle","description":"We talk about Fastify","archived":false,"fork":false,"pushed_at":"2023-01-06T01:05:42.000Z","size":9378,"stargazers_count":3,"open_issues_count":18,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-03T16:13:15.975Z","etag":null,"topics":[],"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/webeetle.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":"2020-04-01T06:41:11.000Z","updated_at":"2022-05-01T06:39:26.000Z","dependencies_parsed_at":"2023-02-05T01:17:21.130Z","dependency_job_id":null,"html_url":"https://github.com/webeetle/wetalk-fastify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/webeetle/wetalk-fastify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webeetle%2Fwetalk-fastify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webeetle%2Fwetalk-fastify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webeetle%2Fwetalk-fastify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webeetle%2Fwetalk-fastify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webeetle","download_url":"https://codeload.github.com/webeetle/wetalk-fastify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webeetle%2Fwetalk-fastify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33930307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-14T09:49:48.075Z","updated_at":"2026-06-05T04:31:45.022Z","avatar_url":"https://github.com/webeetle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# We talk about Fastify\n\n## Example 1\n\nA Basic example on fastify usage\n\n```\nconst fastify = require('fastify')({ logger: true })\n\n// Declare a route for our application\nfastify.get('/', async (req, res) =\u003e {\n  return { hello: 'world' }\n})\n\nconst startServer = async port =\u003e {\n  try {\n    await fastify.listen(port)\n    fastify.log.info(`Server started on http://localhost:${port}`)\n  } catch (e) {\n    fastify.log.error(e)\n    process.exit(1)\n  }\n}\n\nstartServer(3000)\n```\n\n## Example 2\n\nOur first route\n\n```\nasync function routes (fastify, options) {\n  fastify.get('/', async (request, reply) =\u003e {\n    return { hello: 'World' }\n  })\n}\n\nmodule.exports = routes\n```\n\n## Example 3\n\nRegister multiple routes with different log level \n\n```\nfastify.register(require('./api-v1.js'), { prefix: '/v1', logLevel: 'error' })\nfastify.register(require('./api-v2.js'), { prefix: '/v2' })\n```\n\n## Example 4\n\nLearn about JSON Schema and Hooks\n\n```\nfastify.route({\n  method: 'POST',\n  url: '/',\n  schema: {\n    body: S.object()\n      .prop('name', S.string().required()),\n    response: {\n      200: S.object()\n        .prop('message', S.string())  \n    }\n  },\n  onRequest: async (request, reply) =\u003e {\n    fastify.log.info(\"onRequest\")\n  },\n  preValidation: async (request, reply) =\u003e {\n    fastify.log.info(\"preValidation\")\n  },\n  preHandler: async (request, reply) =\u003e {\n    fastify.log.info(\"preHandler\")\n  },\n  preSerialization: async (request, reply) =\u003e {\n    fastify.log.info(\"preSerialization\")\n  },\n  handler: async (request, reply) =\u003e {\n    const { name } = request.body\n    return { message: `Hello, ${name}` }\n  }\n})\n```\n\n## Example 5\n\nCreate Fastify App. Create a ticket CRUD example\n\n- [Fluent Schema](https://github.com/fastify/fluent-schema)\n- [Swagger](https://github.com/fastify/fastify-swagger)\n- [Mongo DB](https://github.com/fastify/fastify-mongodb)\n- [Fastify Plugin](https://github.com/fastify/fastify-plugin)\n\n## Example 6\n\nAdd JWT Authentication \n\n- [Fluent Schema](https://github.com/fastify/fluent-schema)\n- [Swagger](https://github.com/fastify/fastify-swagger)\n- [Mongo DB](https://github.com/fastify/fastify-mongodb)\n- [Fastify Plugin](https://github.com/fastify/fastify-plugin)\n- [Fastify JWT](https://github.com/fastify/fastify-jwt)\n\n## Example 7\n\nSplit previous example in two microservices with an API gateway\n\n- [Fluent Schema](https://github.com/fastify/fluent-schema)\n- [Swagger](https://github.com/fastify/fastify-swagger)\n- [Mongo DB](https://github.com/fastify/fastify-mongodb)\n- [Fastify Plugin](https://github.com/fastify/fastify-plugin)\n- [Fastify JWT](https://github.com/fastify/fastify-jwt)\n- [Fastify HTTP Proxy](https://github.com/fastify/fastify-http-proxy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebeetle%2Fwetalk-fastify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebeetle%2Fwetalk-fastify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebeetle%2Fwetalk-fastify/lists"}