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
- Swift 3+
- PostgreSQL 9+
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
);
swift build -Xcc -I/usr/local/include -Xlinker -L/usr/local/lib/
.build/debug/Deploy
- 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
This project does not include Security capabilities of Kitura. For more info about Kitura, visite http://www.kitura.io/en/resources/tutorials.html.