GithubHelp home page GithubHelp logo

up's Introduction

up

Server framework on top of Unix Domain Sockets (implementation in Golang). This can be used to run desktop apps as a separate process serving the HTML, CSS, Js files and a frontend WebKit or Gecko Process can render the view of the app.

Why this can be better?

Nowadays a lot of desktop apps are being written on top of electron framework. First of, bundling a whopping 40 Megs of stuff for each app is just space killer. And This can be implemented in any insane language or scripting available thus lifting some the limitations of Javascript. There is a limitation that this can only be used in Unix (or Linux).

Sample Usage of this package

package main

import (
	"fmt"

	"github.com/aki237/up"
)

func main() {
	app, err := up.NewApp("Test", "org.testorg.test")
	if err != nil {
		fmt.Println(err)
		return
	}
	app.HandleFunc("/welcome/:name", f)
	app.Run()
}

func f(r *up.Request) up.Response {
	return up.Response("Hello, " + r.Parameters["name"] + "!!")
}

Test this using the socat tool : (socat is like telnet for Unix Domain Sockets)

$ socat - UNIX:/tmp/$USER_org.testorg.test.app
{"method" : "GET", "uri" : "/welcome/John"}

Hello, John!!

Thoughts

  • Use msgpack for data format
  • Modify electron framework or WebKit to work directly with this

up's People

Contributors

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