Skip to content

This project is a simple HTTP server implemented in Rust, showcasing the creation of custom request-response handler and the SQLx database library. It provides a foundation for building scalable and efficient web applications using Rust's strong type system.

Notifications You must be signed in to change notification settings

harrybasra95/rust-web-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Web Server

This project is a simple HTTP server implemented in Rust, showcasing the use of the Actix web framework and the SQLx database library. It provides a foundation for building scalable and efficient web applications using Rust's strong type system and concurrency model.

Table of Contents

Getting Started

To run the Rust web server locally, follow these steps:

  1. Ensure you have Rust installed. If not, follow the installation instructions at https://www.rust-lang.org/tools/install.
  2. Set up a PostgreSQL database. Make sure you have a PostgreSQL server running and create a database for the project.
  3. Clone the repository and navigate to the project directory.
  4. Set the DATABASE_URL environment variable to your PostgreSQL database URL. For example:
    DATABASE_URL=postgres://postgres:password@localhost:5432/server
  5. Build and run the server using Cargo
    cargo run
  6. The server should now be running on localhost:3000.

Usage

Instructions on how to use the project once it's set up. Include any commands or steps required to start the application.

  1. Start the application: cargo run
  2. Open a web browser and navigate to http://localhost:3000

Configuration

Explain any configuration options available for the project. This could include environment variables, configuration files, or command-line options.

  • DATABASE_URL - Postgres url.

Contributing

Explain how others can contribute to the project. Include guidelines for bug reports, feature requests, and pull requests.

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature/your-feature
  3. Make changes and commit: git commit -m "Add your feature"
  4. Push to the branch: git push origin feature/your-feature
  5. Create a pull request.

License

Specify the project's license information. For example:

This project is licensed under the MIT License.

About

This project is a simple HTTP server implemented in Rust, showcasing the creation of custom request-response handler and the SQLx database library. It provides a foundation for building scalable and efficient web applications using Rust's strong type system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published