Skip to content

philhanna/restserver

Repository files navigation

Restserver

Go Report Card PkgGoDev

Overview

This is a sample REST server application inspired by the tutorial here. I have added an SQLite3 database as a backing store.

Installation

  • 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.

References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages