This is a very simple HTTP server for Unix, using fork(). It's very easy to use
- include header
httpd.h - write your route method, handling requests.
- call
serve_forever("12913")to start serving on port 12913
| set imap_user="mail.vpal@gmail.com" | |
| set imap_pass=`/usr/bin/security find-generic-password -w -a 'mail.vpal@gmail.com' -s 'Gmail'` | |
| set folder=imaps://imap.gmail.com/ | |
| set spoolfile=+INBOX | |
| set record="+[Gmail]/Sent Mail" | |
| set postponed="+[Gmail]/Drafts" | |
| # https://www.neomutt.org/guide/reference search sleep_time for additional info | |
| set sleep_time=0 # be faster |
| # nimshorturl | |
| # Copyright xmonader | |
| # nim url shortening service | |
| import jester, asyncdispatch, htmlgen, json, os, strutils, strformat, db_sqlite | |
| # hostname can be something configurable "http://ni.m:5000" | |
| let hostname = "localhost:5000" | |
| var theDb : DbConn | |
| if not fileExists("/tmp/mytest.db"): | |
| theDb = open("/tmp/mytest.db", "", "", "") | |
| theDb.exec(sql("""create table urls ( |

| @ECHO OFF | |
| IF "%~1"=="" GOTO noargs | |
| mingw32-gcc.exe -Wall -O2 -c %1.c -o %1.o | |
| mingw32-g++.exe -o %1.exe %1.o -s | |
| PAUSE | |
| GOTO endprogram |