This is a sample REST server application inspired by the tutorial here. I have added an SQLite3 database as a backing store.
- Clone the git repository:
git clone git@github.com:philhanna/restserver.git
- Create a
config.yml
file in$HOME/.config/restserver
(on Windows,%appdata%\restserver
)
host: localhost
port: 10000
dbname: /tmp/articles.db
dbsql: |
dbsql: |
DROP TABLE IF EXISTS articles;
CREATE TABLE articles (
id INTEGER PRIMARY KEY,
title TEXT,
description TEXT,
content TEXT
);
BEGIN;
INSERT INTO articles VALUES(null, "Hello 1", "Article 1 description", "Article 1 content");
INSERT INTO articles VALUES(null, "Hello 2", "Article 2 description", "Article 2 content");
COMMIT;
Adjust the port
and dbname
values as needed.