{"id":22336735,"url":"https://github.com/kavicastelo/node_template","last_synced_at":"2026-04-04T20:33:09.795Z","repository":{"id":204955984,"uuid":"712966958","full_name":"kavicastelo/node_template","owner":"kavicastelo","description":"Node Server Template is a Node.js package that provides a simplified and configurable server setup for your applications.","archived":false,"fork":false,"pushed_at":"2023-11-24T11:34:53.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-11T21:55:37.112Z","etag":null,"topics":["backend","bootstrap","config","node","nodejs-server"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kavicastelo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2023-11-01T15:13:16.000Z","updated_at":"2025-04-05T22:50:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"750e4342-80ae-47ba-9f6e-350a99a47e07","html_url":"https://github.com/kavicastelo/node_template","commit_stats":null,"previous_names":["kavicastelo/servertemplate"],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/kavicastelo/node_template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavicastelo%2Fnode_template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavicastelo%2Fnode_template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavicastelo%2Fnode_template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavicastelo%2Fnode_template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kavicastelo","download_url":"https://codeload.github.com/kavicastelo/node_template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavicastelo%2Fnode_template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31413269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: 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":["backend","bootstrap","config","node","nodejs-server"],"created_at":"2024-12-04T06:07:51.815Z","updated_at":"2026-04-04T20:33:09.771Z","avatar_url":"https://github.com/kavicastelo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node Server Template\n\nNode Server Template is a Node.js package that provides a simplified and configurable server setup for your\napplications. It includes common server configurations and utilities, making it easier to bootstrap your projects.\n\n## Features\n\n- **Express.js Integration:** Easily create Express.js server instances.\n- **Mongoose Database Connection:** Configure MongoDB database connection with Mongoose.\n- **Advanced Configuration:** Choose between basic server setup or advanced configuration with custom HTTP server\n  options.\n- **API Endpoint Testing:** Sample API endpoint for testing purposes.\n- **Model Creation:** Utility function to create Mongoose models easily.\n\n## Installation\n\n```bash\nnpm install @kavicastelo/node_template\n```\n\n## Usage\n\n```javascript\nconst { configureServer, advancedConfigureServer, testGet, createModel } = require('my-server-template');\n\n// Basic Server Configuration\nconfigureServer('mongodb://localhost:27017/mydatabase', 3000);\n\n// Advanced Server Configuration\nadvancedConfigureServer('mongodb://localhost:27017/mydatabase', 3000);\n\n// Sample API Endpoint\ntestGet();\n\n// Create Mongoose Model\nconst schemaDefinition = {\n    // Define your schema fields here\n};\n\nconst modelName = 'MyModel';\nconst MyModel = createModel(schemaDefinition, modelName);\n```\n\n## API Reference\n### **configureServer(databaseUrl: string, serverPort: number)**\nBasic server configuration with Express.js. Connects to the MongoDB database specified by `databaseUrl` and starts the server on the provided `serverPort`.\n\n### **advancedConfigureServer(databaseUrl: string, serverPort: number)**\nAdvanced server configuration with custom HTTP server options. Connects to the MongoDB database specified by `databaseUrl` and starts the server on the provided `serverPort`.\n\n### **testGet()**\nCreates a sample GET API endpoint at the root ('/') for testing purposes.\n\n### **createModel(schemaDefinition: object, modelName: string)**\nCreates a Mongoose model with the given schema definition and model name.\n\n## Contributing\nFeel free to contribute to this project by opening issues or submitting pull requests. Your feedback and contributions are highly appreciated!\n\nLicense\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkavicastelo%2Fnode_template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkavicastelo%2Fnode_template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkavicastelo%2Fnode_template/lists"}