Skip to content
No description, website, or topics provided.
Nim
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitignore
.ruby-version
LICENSE
README.md
http.nimble
nim.cfg

README.md

http

TODO: not in nimble, for now clone it

nimble install http

Introduction

http is a web lib

import http

# norm

norm:
  type
    Article = object
      title: string
      author: string
      text: string

init:
  var article = Article(
    title: "title",
    author: "author",
    text: "")
  article.insert()

createModels()

handler home:
  var articles = Article.getMany(20)
  render "home_view"

handler article(id: int):
  var a = Article.getOne("id=?", id)
  render "article_view"

route:
  get "/article/@id:int": article
  get "/": home


server()

It is just a pipeline using

The current code is mostly an early alpha version and some of it is adapted from https://github.com/dom96/jester/: credits!

The goal is to define a phoenix/rails-like framework with

  • validation dsl
  • swappable orm / view etc layers
  • good websocket/client framework interop

Create a project

A new project is created similarly to rails: you can enter a command which fills in a directory with start files with structure based on nimble init

> http new --project=blog

creating new project blog
  create README.md
  create blog.nimble
  create .gitignore
  create src/
  create src/blog.nim
  create tests/
  create views/
  create views/home.nim

create a model

> http model --name=article

  create src/models/article.nim
  patch src/model.nim

Contributing

Would love any ideas and contributions. Keep in mind you can also contribute to [https://github.com/dom96/jester/](jester by dom96) or [https://github.com/andreaferretti/rosencrantz](rosencrantz by andreaferretti)

License

Licensed and distributed under

You can’t perform that action at this time.