{"id":15497231,"url":"https://github.com/jwerle/pineapple","last_synced_at":"2025-04-22T21:33:27.598Z","repository":{"id":66153591,"uuid":"7082396","full_name":"jwerle/pineapple","owner":"jwerle","description":"[DEAD] A very simple, fun, and extendable RESTful API framework that includes routing and a model wrapper around MongoDB. Built for MVC idealists. A framework that just steps out of the way and helps you get your data.","archived":false,"fork":false,"pushed_at":"2014-01-04T17:00:21.000Z","size":1756,"stargazers_count":35,"open_issues_count":2,"forks_count":9,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-29T19:03:15.772Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/jwerle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2012-12-09T19:19:09.000Z","updated_at":"2020-05-05T18:17:19.000Z","dependencies_parsed_at":"2023-02-19T23:30:54.756Z","dependency_job_id":null,"html_url":"https://github.com/jwerle/pineapple","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fpineapple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fpineapple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fpineapple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fpineapple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwerle","download_url":"https://codeload.github.com/jwerle/pineapple/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250329039,"owners_count":21412742,"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":"2024-10-02T08:32:11.956Z","updated_at":"2025-04-22T21:33:27.577Z","avatar_url":"https://github.com/jwerle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"pineapple\n===============\n\nhttp://pineapple.werle.io/\n\n[![Build Status](https://travis-ci.org/jwerle/pineapple.png?branch=master)](https://travis-ci.org/jwerle/pineapple)\n\n\nA MVC based, yet arguably liberal RESTful API framework. \nIncludes routing, controllers, models, utilities, and a MongoDB interface.\n\n# NO LONGER SUPPORTED\n\n# Table of Contents\n* [Install](#install)\n* [Documentation](https://github.com/jwerle/pineapple/wiki)\n* [Change Log](https://github.com/jwerle/pineapple/blob/master/CHANGELOG.md)\n* [Creating a new application](#creating-a-new-app)\n* [Starting a Server](#starting-a-pineapple-server)\n* [Starting a Console](#starting-a-pineapple-console)\n* [Application Structure](#basic-app-structure)\n* [Issues](#issues)\n* [Community](#community)\n* [License](#copyright-and-license)\n\n## Install\n\n`pineapple` requires global installation for the CLI utilitiy. If you do not plan on using pineapple to manage a pineapple\napplication from the command line then using it as a local module is fine.\n\n```sh\n$ [sudo] npm install -g pineapple\n```\n\n---\n[top](#pineapple)\n\n\n## Creating a new app\n\n`pineapple gen \u003cname\u003e`\n\nCreating a pineapple application can easily be achieved with `pineapple gen`\n\n```sh\n$ pineapple gen myapp\n[pineapple] =\u003e Going to grab all of those dependencies now..\n[pineapple] =\u003e This may take a while..\n[pineapple] =\u003e Sweet! I've created a new Pineapple application here =\u003e /Users/werle/myapp\n```\n\n---\n[top](#pineapple)\n\n\n## Starting a pineapple server\n\n`pineapple server`\n\nStarting a pineapple server of a pineapple application is as simple as executing `pineapple server` from the directory of\nthe pineapple application.\n\n## shell\n\n```sh\n$ pineapple server\nRequiring app module /config/environment\nRequiring app module /config/development\nRequiring app module /config/application\nRequiring app module /config/routes.js\nRequiring app module /app/controllers\nRequiring app module /app/models\n[app] =\u003e Found the Paplfile file. =\u003e /Users/werle/repos/myapp/Paplfile\n[server] =\u003e Listening on port 4000\n```\n\n## node\n\nYou could utilize the pineapple module and create your own server without using a skeleton pineapple application.\nThe contents of the `app.js` file below whose only dependency is `pineapple` demonstrates the process\nof using pineapple in node with minimal requirements. Consider the following app structure:\n\n```sh\n├── app.js\n└── node_modules\n    └── pineapple (pineapple module)\n```\n\nYou could then use pineapple to create a server, bind routes, and listen on a port to start the service.\n\n```js\n// it isn't needed to store pineapple in a variable as it is attached\n// to the global object during its bootstrap\nrequire('pineapple');\n\n// define an app name \nvar appName = \"myService\";\n\n// server config\nvar serverConfig = {\n  config : { \n    name : appName\n  }\n};\n\n// Let pineapple no about your app name\npineapple.app.name = appName;\n\n// we can create a server with minimal configuration\npineapple.api.create(serverConfig);\n\n/**\n * In order for your server to work we will need some routes set up.\n * That can easily be achieved with pineapple's built in router.\n * \n * The Router supports basic POST, GET, PUT, and DELETE protocols via\n * convenience methods:\n *  router.post(uri_path, [controller_path|callback]); // POST\n *  router.get(uri_path, [controller_path|callback]); // GET\n *  router.put(uri_path, [controller_path|callback]); // PUT\n *  router.del(uri_path, [controller_path|callback]); // DELETE\n *\n * If you need to set a custom method you can call .create() directly:\n *  router.create(CUSTOM_METHOD, uri_path, [controller_path|callback]);\n **/\n// we need to create a router instance\nvar router = new pineapple.router.Router();\n\n// lets get a \"Hello world\" going\nrouter.get('/hello', function(request, response){\n  var request  = this.request\n    , response = this.response\n    \n  // output some sanity\n  pineapple.api.logger.success(\"Got the request, emitting response..\");\n\n  // response with a json response\n  this.json({\n    message  : \"Hello world! I'm a pineapple api server.\"\n  });\n});\n\n// we need to bind the routes we just created to the server\npineapple.api.bindRoutes(router.routes);\n\n// once all is said and done, we can finally start the server\n// the .listen() method accept a port and a callback for arguments\npineapple.api.listen(4000);\n```\n\nFrom the command line you can then execute the `app.js` file with the `node` executable\nwhich will output something like this:\n\n```sh\n$ node app.js\n```\n\nFrom the browser or from a program like [cURL](http://curl.haxx.se/docs/manpage.html) you could hit the following url `http://localhost:4000/hello` while your app is running.\n\n```sh\n$ curl http://localhost:4000/hello\n{\"code\":200,\"status\":true,\"data\":{\"message\":\"Hello world! I'm a pineapple api server.\"}}\n```\n\n---\n[top](#pineapple)\n\n## Starting a pineapple console\n\n```\n$ pineapple console\n...\n\neverybit-local\u003e pineapple.models\n{ User: { [Function: User] super: [Function] },\n  Profile: { [Function: Profile] super: [Function] },\n  CreditCard: { [Function: CreditCard] super: [Function] },\n  Video: { [Function: Video] super: [Function] },\n  Version: { [Function: Version] super: [Function] },\n  Media: { [Function: Media] super: [Function] },\n  Image: { [Function: Image] super: [Function] },\n  Blurb: { [Function: Blurb] super: [Function] },\n  Audio: { [Function: Audio] super: [Function] },\n  user: \n   { User: { [Function: User] super: [Function] },\n     Profile: { [Function: Profile] super: [Function] },\n     CreditCard: { [Function: CreditCard] super: [Function] } },\n  media: \n   { Video: { [Function: Video] super: [Function] },\n     Version: { [Function: Version] super: [Function] },\n     Media: { [Function: Media] super: [Function] },\n     Image: { [Function: Image] super: [Function] },\n     Blurb: { [Function: Blurb] super: [Function] },\n     Audio: { [Function: Audio] super: [Function] } },\n  getSchema: [Function] }\neverybit-local\u003e \n```\n\n---\n[top](#pineapple)\n\n\n## Basic app structure\n\n```\nmyapp/\n├── Capfile\n├── Jakefile\n├── Paplfile\n├── Procfile\n├── README.md\n├── app\n│   ├── controllers\n│   │   ├── Application.js\n│   │   ├── index.js\n│   │   └── pineapple\n│   │       ├── Api.js\n│   │       └── index.js\n│   └── models\n│       └── index.js\n├── config\n│   ├── README.md\n│   ├── application.json\n│   ├── development.json\n│   ├── environment.json\n│   ├── production.json\n│   └── routes.js\n├── index.js\n├── package.json\n└── test\n    └── app\n        └── README.md\n```\n\n---\n[top](#pineapple)\n\n## Issues?\n\nSubmit all bugs [here](https://github.com/jwerle/pineapple/issues/new)\n\n---\n[top](#pineapple)\n\n## Community\n\nJoin the google group [here](https://groups.google.com/forum/?hl=en\u0026fromgroups#!forum/pineapplejs)\n\nIRC? Hang out with us at #papl\n\n---\n[top](#pineapple)\n\nCopyright and license\n---------------------\n\nCopyright 2012\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this work except in compliance with the License.\nYou may obtain a copy of the License in the LICENSE file, or at:\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n- - -\n\n**pineapple** copyright 2012\nwerle.io - joseph@werle.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwerle%2Fpineapple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwerle%2Fpineapple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwerle%2Fpineapple/lists"}