{"id":16329987,"url":"https://github.com/luin/suki","last_synced_at":"2025-05-15T09:14:25.634Z","repository":{"id":66160860,"uuid":"16021631","full_name":"luin/Suki","owner":"luin","description":"An elegant web framework for node.js","archived":false,"fork":false,"pushed_at":"2014-02-05T14:13:43.000Z","size":794,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-26T07:41:28.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","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/luin.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}},"created_at":"2014-01-18T08:12:07.000Z","updated_at":"2014-06-03T23:24:34.000Z","dependencies_parsed_at":"2023-02-19T23:25:19.139Z","dependency_job_id":null,"html_url":"https://github.com/luin/Suki","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/luin%2FSuki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luin%2FSuki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luin%2FSuki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luin%2FSuki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luin","download_url":"https://codeload.github.com/luin/Suki/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239269808,"owners_count":19610870,"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-10T23:18:05.000Z","updated_at":"2025-02-17T10:15:37.869Z","avatar_url":"https://github.com/luin.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WORK IN PROGRESS ᕕ( ᐛ )ᕗ\n\nHowever, there is a working example in the `example` folder.\n\n[![Build Status](https://travis-ci.org/luin/Suki.png?branch=master)](https://travis-ci.org/luin/Suki) [![Dependencies Status](https://david-dm.org/luin/suki.png)](https://david-dm.org/luin/suki)\n\n\n* * *\n\nSuki means *like*(好き) in Japanese.\n\n# Get started\n\n## Build a RESTful API within 2 minutes\n\nIn this tutorial, we will explain how to create a simple application that provides a RESTful API using the Suki framework.\n\n### 0. Define the API\n\nWe will build an API to manage books. The API consists of the following methods:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eMethod\u003c/th\u003e\n      \u003cth\u003eURL\u003c/th\u003e\n      \u003cth\u003eAction\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eGET\u003c/td\u003e\n      \u003ctd\u003e/books\u003c/td\u003e\n      \u003ctd\u003eRetrieves all books\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ePOST\u003c/td\u003e\n      \u003ctd\u003e/books\u003c/td\u003e\n      \u003ctd\u003eCreate a new book\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eGET\u003c/td\u003e\n      \u003ctd\u003e/books/:bookId\u003c/td\u003e\n      \u003ctd\u003eRetrieves a specific book\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ePUT\u003c/td\u003e\n      \u003ctd\u003e/books/:bookId\u003c/td\u003e\n      \u003ctd\u003eUpdates a specific book\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eDELETE\u003c/td\u003e\n      \u003ctd\u003e/books/:bookId\u003c/td\u003e\n      \u003ctd\u003eDeletes a specific book\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n### 1. Install Suki\n\nSuki is bundled with an executable. If you install suki globally with npm you'll have it available from anywhere on your machine:\n\n`$ npm install -g suki`\n\n### 2. Create a application\n\nA good beginning is half done. Suki can create a template application for you:\n\n`$ suki new book`\n\nWhere `book` is the name of your application.\n\nAfter execute the command, Suki will create a directory named \"book\" in the current path.\n\n### 3. Define the model\n\nSuki follows the MVC pattern and use the [Sequelize](http://sequelizejs.com) library as the model layer.\n\nNow let's define the book model. We can create the book model using the following command:\n\n`$ suki generate model book`\n\n```CoffeeScript\nmodule.exports = class extends Suki.SequelizeModel\n\n  title: Sequelize.STRING\n  price: Sequelize.INTEGER\n```\n\n### 4. Define the controller\n\n`$ suki create-controller task`\n\n```CoffeeScript\nmodule.exports = class extends Suki.Controller\n\n  # GET /books\n  index: -\u003e\n    Book.findAll().complete (err, books) =\u003e\n      @res.json books\n\n  # POST /books\n  create: -\u003e\n    (Book.create { title: @req.body.title, price: @req.body.price}).complete (err, book) =\u003e\n      @res.json book\n\n  # GET /books/:bookId\n  show: (@book) -\u003e\n    @res.json @book\n\n  # PUT /books/:bookId\n  update: (@book) -\u003e\n    @book.title = req.body.title\n    @book.price = req.body.price\n    @res.json @book.save()\n\n  # DELETE /books/:bookId\n  destroy: (@book) -\u003e\n    @book.destroy()\n    @res.json { \"message\": \"deleted\" }\n```\n\nLicense\n-------\nThe MIT License (MIT)\n\nCopyright (c) 2013 Zihua Li\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluin%2Fsuki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluin%2Fsuki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluin%2Fsuki/lists"}