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.
To run the Rust web server locally, follow these steps:
- Ensure you have Rust installed. If not, follow the installation instructions at https://www.rust-lang.org/tools/install.
- Set up a PostgreSQL database. Make sure you have a PostgreSQL server running and create a database for the project.
- Clone the repository and navigate to the project directory.
- Set the
DATABASE_URLenvironment variable to your PostgreSQL database URL. For example:DATABASE_URL=postgres://postgres:password@localhost:5432/server
- Build and run the server using Cargo
cargo run
- The server should now be running on localhost:3000.
Instructions on how to use the project once it's set up. Include any commands or steps required to start the application.
- Start the application:
cargo run - Open a web browser and navigate to
http://localhost:3000
Explain any configuration options available for the project. This could include environment variables, configuration files, or command-line options.
DATABASE_URL- Postgres url.
Explain how others can contribute to the project. Include guidelines for bug reports, feature requests, and pull requests.
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature - Make changes and commit:
git commit -m "Add your feature" - Push to the branch:
git push origin feature/your-feature - Create a pull request.
Specify the project's license information. For example:
This project is licensed under the MIT License.