Code Monkey home page Code Monkey logo

kitura-couchdb's Introduction

Kitura

APIDoc Build Status - Master macOS Linux Apache 2 Slack Status

Kitura-CouchDB

Kitura-CouchDB is a pure Swift client which allows Kitura applications to interact with a CouchDB database.

Usage

Add dependencies

Add the Kitura-CouchDB package to the dependencies within your application’s Package.swift file. Substitute "x.x.x" with the latest Kitura-CouchDB release.

.package(url: "https://github.com/IBM-Swift/Kitura-CouchDB.git", from: "x.x.x")

Add CouchDB to your target's dependencies:

.target(name: "example", dependencies: ["CouchDB"]),

Import package

import CouchDB

Use Kitura-CouchDB locally

The CouchDBSample executable demonstrates how to create, read, update and delete documents within a CouchDB database in Swift.

  1. Download CouchDB and install.

  2. Set up an admin username and password in CouchDB.

  3. Create a database with the name kitura_test_db.

  4. Clone this repository:

    git clone https://github.com/IBM-Swift/Kitura-CouchDB.git
  5. Update the following code in Sources\CouchDBSample\main.swift with your admin username and password (the host will default to 127.0.0.1 and the port will default to 5984):

    let connProperties = ConnectionProperties(
        host: host,         // httpd address
        port: port,         // httpd port
        secured: secured,   // https or http
        username: nil,      // admin username
        password: nil       // admin password
    )
  6. Open a Terminal window, change into the Kitura-CouchDB folder and run swift build:

    swift build
  7. Run the CouchDBSample executable:

    .build/debug/CouchDBSample

    You will see informational messages such as "Successfully created the following JSON document in CouchDB:" for each of the operations (create, read, update and delete) performed on the kitura_test_db database.

Example

For a more comprehensive example, you can follow the Kitura tutorial Getting Started with Server-side Swift on raywenderlich.com that shows you how to create a backend API and then link this to a CouchDB instance running on your local machine.

API Documentation

For more information visit our API reference.

Community

We love to talk server-side Swift, and Kitura. Join our Slack to meet the team!

License

This library is licensed under Apache 2.0. Full license text is available in LICENSE.

kitura-couchdb's People

Contributors

rolivieri avatar shmuelk avatar dfirsht avatar bdhernand avatar rfdickerson avatar irar2 avatar quanvo87 avatar ianpartridge avatar vadimeisenbergibm avatar youming-lin avatar helenmasters avatar andrew-lees11 avatar carlbrown avatar djones6 avatar yoiang avatar corcoja avatar nikitasullivan avatar rob-deans avatar samwarfield avatar shihabmehboob avatar saihemak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.