All Projects → mtmr0x → rust-web-boilerplate

mtmr0x / rust-web-boilerplate

Licence: other
An implementation of a simple web server using Rust

Programming Languages

rust
11053 projects
shell
77523 projects

Projects that are alternatives of or similar to rust-web-boilerplate

web-haskell-graphql-postgres-boilerplate
Modern webserver in Haskell: Graphql + Postgresql + Authentication + DB migration + Dotenv and more
Stars: ✭ 114 (+216.67%)
Mutual labels:  webserver, webserver-setup
quickserv
Dangerously user-friendly web server for quick prototyping and hackathons
Stars: ✭ 275 (+663.89%)
Mutual labels:  webserver, webserver-setup
khudro
Khudro is a very light weight web-server built with C.
Stars: ✭ 19 (-47.22%)
Mutual labels:  webserver
go-echo-server-sandbox
A scaffold of golang web server using labstack/echo
Stars: ✭ 12 (-66.67%)
Mutual labels:  webserver
heartbeat
A service to keep a live heartbeat (ping) on multiple devices
Stars: ✭ 27 (-25%)
Mutual labels:  webserver
WebServer
C++高性能网络服务器
Stars: ✭ 53 (+47.22%)
Mutual labels:  webserver
rpi-nginx
[DEPRECATED] NGINX on Raspberry Pi / ARM
Stars: ✭ 20 (-44.44%)
Mutual labels:  webserver
fcgi-function
A cross-platform module to writing C/C++ service for nginx.
Stars: ✭ 33 (-8.33%)
Mutual labels:  webserver
WebListener
A simple, lightweight, PowerShell-based web server, designed for small, temporary projects.
Stars: ✭ 29 (-19.44%)
Mutual labels:  webserver
Anti-DDOS-Script
Anti DDOS Protection that will stop DDOS from taking down your Linux Server
Stars: ✭ 51 (+41.67%)
Mutual labels:  webserver
ruby wolf
Tiny ruby web server for research and studying purpose
Stars: ✭ 19 (-47.22%)
Mutual labels:  webserver
embedio-extras
Additional Modules showing how to extend EmbedIO.
Stars: ✭ 43 (+19.44%)
Mutual labels:  webserver
wnmp-dev
Development environment: Windows + nginx + MySQL + PHP
Stars: ✭ 52 (+44.44%)
Mutual labels:  webserver
Teapot
Teapot micro web framework for Pharo Smalltalk
Stars: ✭ 86 (+138.89%)
Mutual labels:  webserver
SpotifyWebApi
A .net core wrapper for the Spotify Web API
Stars: ✭ 19 (-47.22%)
Mutual labels:  webserver
internetarchivebot
iabot.toolforge.org
Stars: ✭ 67 (+86.11%)
Mutual labels:  webserver
WebServer
Powershell WebServer is a Powershell module that starts a webserver (without the need for IIS)
Stars: ✭ 27 (-25%)
Mutual labels:  webserver
initial-webserver-setup
Ansible playbook for initial ubuntu 16.04 webserver setup and Laravel zero time deployment
Stars: ✭ 50 (+38.89%)
Mutual labels:  webserver
phpkoa
PHP异步编程: 基于 PHP 实(chao)现(xi) NODEJS web框架 KOA。
Stars: ✭ 52 (+44.44%)
Mutual labels:  webserver
natural
Fastest Framework for NodeJS. Written in pure ES6+
Stars: ✭ 30 (-16.67%)
Mutual labels:  webserver

Rust Web Server Boilerplate

Start developing your Rust server based in this simple set up.

The following instructions are for MacOS or Linux.

If something doesn't work, open an issue or open a Pull Request following contribution guidelines;

Quick overview

# copy env sample file to .env file
cp ./.env.sample ./.env

# open it and replace its values
vim ./.env

Follow env files section for understanding it.

Then start the server using the start.sh script.

./start.sh # make sure you gave permissions to it

Table of contents

Installation

Install Rust

Go to https://www.rust-lang.org/tools/install and check installation methods

Note: this project is set with version 1.34.1 and tested with 1.29.0 and worked pretty well. You can define your version of Rust at your environment variables.

Set up

Environment variables

For properly run this project, you will have to set some environment variables. Everything you need to set up is located in .env.sample file.

Every update in your .env file you must add the new variable to the process at your start up script before running it. Open and edit the start.sh file present in the root directory of this project.

Run

Execute the start.sh script located in the this project:

./start.sh

Features

Logger

Logger configurations depends on LEVEL_VERBOSITY environment variable for deciding what levels of logs can be printed. LEVEL_VERBOSITY documentation and usage is present in .env.sample file.

stdout log:

The application logs stdout for instrumentation and its format is present in src/logger/logger.rs file, logging hour, target, level and message.

output file log:

The file output is set as output.log file, that will be present in the root directory as it has logs. It prints the same format of stdout logs with addition of Year, Month and Day of that output before the time of it.

Configuration

This application tries to follow configuration over convention. All types of configurations that is not Rust convention is placed as environment variable and all of them must be set, otherwise the application will fail to start.

You can find all necessary environment variables documented for this project inside .env.sample file.

Routing

This project is meant to be easy for people coming from NodeJS and that said the closest way to get there was to find a routing declaration library and framework that could make web development similar to ExpressJS or Koa. Iron and Router did the job.

To-do list

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].