Giter VIP home page Giter VIP logo

prometheus's Introduction

Prometheus

I started writing this web framework for the future online shop of my school. This was my first real go project and i really enjoined the typing experience of the language, at first. I would run into problems here and there which i could overlook or hack around, something i couldn't work around was the support for Generics. This is why i abandoned this project and switched to rust-lang.

Development Process

I started looking into NodeJS frameworks like Express and NestJS but i found them to be to abstracted away, i couldn't really see what was going on under the hood and i wanted something were i knew what was going on. So i decided to write my own.

I chose go because i recently tried it for the first time and i really liked the syntax. Further more i heard that google was using it to parse html documents for there search engine and i wanted something fast so i figured, let it be go.

The Router

I started by writing my own Router seen here:

type Router struct {
	Routes 			map[string]*Service
	DefaultRoute 	string
}

it consisted of Routes which where mapped to a Pointer to Service. This way you could have multiple routes pointing to one service, for example "/hello" -> *HelloWorldService, "/hello-world" -> *HelloWorldService and the service would respone if the url path was prefix with the path of the route so "/hello/some-random-string" would still be mapped to the service HelloWorldService. The default route field was, if set, written out to the response writer if the requested route could not be found in the map. By this point it was a pretty primitive router but i wanted to add the option to chain services together.

prometheus's People

Contributors

michaelvanstraten avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.