Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/juanadelacuesta/blog

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/juanadelacuesta/blog

  • v0.0.0-20180920155657-642de41607a3
  • Source
  • Go
  • Socket score

Version published
Created
Source

Simple blog

Simple blog posts visor where you can see and search all the available posts written in Go using Gorilla Mux and the Mysql driver. The API has three endpioints:

NameActionMethodPath
IndexindexGET"/"
Showshow post detailsGET"/post/{id}
Search*search for a postGET"/search?q={searchTerms}

*The search enpoint returns a json including the ID and Title of the posts matching the search terms.

Getting Started

Too run the server go to the file and execute the EC-blog file, or run it with go build it and run it usign Go.

Prerequisites

You should provide a Mysql database with the following table:

CREATE TABLE IF NOT EXISTS posts (
    id INT AUTO_INCREMENT PRIMARY KEY,
    title  VARCHAR(50) NOT NULL,
    body TEXT,
    created IMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (id)
) 

Also provide through env variables:

  • DB_NAME Name of the database
  • DB_USER User for the dabase
  • DB_PASSWORD Password for the user

In order to contribute you need to download the package Gorilla Mux and the driver for Mysql

Running the tests

To run the test go to the project folder and run

go test

.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

FAQs

Package last updated on 20 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc