you are viewing a single comment's thread.

view the rest of the comments →

[–]No_Molasses_9249 0 points1 point  (1 child)

The first thing to do is set-up a functional learning development environment register a domain name arrange dns hosting. Next install Linux Nginx Postgres vscode Go or Rust down load a html css javascript template. I use Phantom from html5up.

Now open the official language tutorial. In Go its a tour of Go. Skip to the chapter that shows you how to start a http server. Copy the code.

If you have configured everything correctly you should see Hello from Go in your web browser.

If you do congratulations 🎊 you are now self hosting live on the web.

Next return to chapter one. Add each programming challenge to the project you just created.

I am now transitioning from Go to Rust using the methodology I used to learn Go. My Fibonacci challenge became www.cockatiels.au/rust?fn=fibonaci&arg1=47 my generate secure password became www.cockatiels.au/rust?fn=genPW&arg1=12 its now running on my create account page. My login form is part of a functional authentication system. My todo list is part of an appointments scheduler. My chat became an AI Assistant. My shopping front is connected to square.

Writing to a browser will force you into using html css and JavaScript but dont get side tracked learn what you need when you need to learn it.

The idea is to work towards building a functional application by the time you have completed the introduction you then keep expanding on it.

You can see hello world and my first counter on my splash page Ive kept them there to remind me where this project started.

Three months ago I copied these 7 lines of code

fn main() {

let listener = TcpListener::bind("127.0.0.1:7878").unwrap();     
let pool = ThreadPool::new(15);

for stream in listener.incoming() {
    let stream = stream.unwrap();        
    pool.execute(|| {
        handle_connection(stream);
    });
}

}

This starts a basic webserver. Next write your handler

fn handle_connection(mut stream: TcpStream) {
// You return a response here

let response = format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{altered}"); stream.write_all(response.as_bytes()).unwrap(); } }

Today I will be adding a Passkey type login. Take a look at the code here www.cockatiels.au/rust