url_shortener

command
v4.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2022 License: MIT Imports: 8 Imported by: 0

README

Description

This is a sample REST URL shortener service implemented using pgx as the connector to a PostgreSQL data store.

Usage

Create a PostgreSQL database and run structure.sql into it to create the necessary data schema.

Configure the database connection with DATABASE_URL or standard PostgreSQL (PG*) environment variables or

Run main.go:

go run main.go

Create or Update a Shortened URL

curl -X PUT -d 'http://www.google.com' http://localhost:8080/google

Get a Shortened URL

curl http://localhost:8080/google

Delete a Shortened URL

curl -X DELETE http://localhost:8080/google

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL