Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.
/ rust-web Public archive

A sample web server using the rust-http library

License

Notifications You must be signed in to change notification settings

am0d/rust-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a sample web server built using the rust-http library from Chris Morgan (http://github.com/chris-morgan/rust-http).

It shows a small demo of serving a number of static files, as well as 2 dynamic routes which render views, and returning 404 errors for non-existant files.

There are many things lacking here yet, but I am trying to flesh out the API for the framework as I go along.

To run the server on 127.0.0.1:8080:
    make run

Currently, the index page (http://127.0.0.1:8080/) as well as 2 todo pages (http://127.0.0.1:8080/todos and http://127.0.0.1:8080/todos/{}) are handled, as well as all the static files required for these.

Future plans include writing a compiler for a Razor-like view syntax (this compiler now resides in a separate repository, http://github.com/am0d/rusty-razor), which would generate Rust code to be compiled with the rest of the framework.  I also still need to hook this up to a database engine, and build in some support for migrations, etc.

Note: I make no claims about this being secure, fast or a recommended way of doing things.  I am writing this framework as an exercise for myself, to learn how a web framework is put together.  I am also not an expert in Rust, and there are likely plenty of things that could be done much better in here.

License: This work is licensed under the MIT license.  See the License file for further details.

About

A sample web server using the rust-http library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published