Skip to content

andyatkinson/freezer-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Freezer Backend

Backend service using Golang Echo

Currently this only works in a local development environment.

Local Development

Running locally:

go run server.go

Dependencies

Using Go modules

Data Seeding

  • create database freezer_development

  • Gorm is responsible for migrating the database

  • The following seed data can be manually inserted. Gorm manages various additional columns about objects.

insert into items (name, added_on) VALUES ('Lasagna for 4 (4)', '2020-02-01');
insert into items (name, added_on) VALUES ('Frozen peas, 1 bag (8 oz.)', '2020-03-01');
insert into items (name, added_on) VALUES ('Popsicles (box) (8)', '2020-04-01');

API

Listing Items

$ curl -H 'Content-Type: application/json' localhost:1323/items

Creating Items

As a JSON payload

curl -d '{"name":"Chicken Nuggets","addedOn":"2020-01-01"}' -H 'Content-Type: application/json' localhost:1323/items

Heroku

Set Go version

heroku config:set GOVERSION=go1.9

About

Add (a description of) stuff to my freezer!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages