Skip to content

vivienlegrand/Kitura-ComputerDatabase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kitura-ComputerDatabase

Sample backend using Kitura 1.3 and Zewo's PostgreSQL adapter.
The project is an updated and simple version of the sample made by IBM : TodoList-PostgreSQL


Requirements

  • Swift 3+
  • PostgreSQL 9+

Installation

For launch the project, run

swift build -Xcc -I/usr/local/include -Xlinker -L/usr/local/lib/

For generate an XCode project :

swift package generate-xcodeproj -Xcc -I/usr/local/include -Xlinker -L/usr/local/lib/ -Xswiftc -I/usr/local/include

Create a cdbtest database with the postgres user, or update the configuration in ComputerDAO.swift. After you can create a computer table :

CREATE TABLE computer
(
    computer_id     bigserial       PRIMARY KEY,
    name            varchar(128)    NOT NULL
);

Launch

swift build -Xcc -I/usr/local/include -Xlinker -L/usr/local/lib/ 
.build/debug/Deploy

APIs

  • Index
    GET with localhost:8090/computer
  • Get by Id
    GET with localhost:8090/computer/:id
  • Add
    POST with localhost:8090/computer
  • Update
    POST with localhost:8090/computer/:id
  • Delete
    DELETE with localhost:8090/computer/:id

More info

This project does not include Security capabilities of Kitura. For more info about Kitura, visite http://www.kitura.io/en/resources/tutorials.html.

About

Simple backend with Kitura 1.2 and PostgreSQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages