Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I do similar, except I just deploy to AWS as a static website. Super duper minimal everything.


If you only have static files, might as well go with Netlify. Can’t beat them for simplicity.


The tutorial stops where it starts to get interesting, actually implementing any logic with the backend other than serving static files. It would have been interesting to follow through a database transaction or see some data / image manipulation.


I actually agree. I extracted this tutorial from a project I'm working on developing an RTS game for school. I'm experimenting with having the game loop run in Rust and seeing if I can send render updates fast enough to smoothly run the UI in JS. It's working pretty well so far. I'm using Protobuf 3. I'd love to get capnproto or flatbuffers working eventually, but neither of them seem to have both JS and Rust support mature yet. I think the next obvious evolution from this tutorial would be to connect a sqlite db. Not sure how easy statically linking with it is though.


Are you talking about statically linking the database itself? Seems like it'd be better to keep the database separate from the binary, unless you're working with a read-only database.

For static-linking the sqlite3 library, if you're using rusqlite you can just specify the bundled feature in Cargo.toml.

``` [dependencies.rusqlite] version = "your-version-number" features = ["bundled"] ```


Yeah I meant statically linking the sqlite library. Thanks for the tip on how to do it


I have such a thing in Haskell: https://github.com/shapr/sporkle/blob/master/app/Main.hs

It's not Rust, but it is a really crappy exercise tracking app I wrote for teaching a class.

Thing different about my code: I build the HTML in the source itself, and I don't use React


If you want to go super-minimal at the cost of being more dependent on Amazon, you can deploy the static website on S3 and use Route53 as an HTTP frontend.


Last week I learned that if you configure your bucket name the same as your domain, then a simple CNAME record will work without Route53.


I don't think you can make SSL work on AWS without Route53, though. Which is (for better or worse) about to become a big problem when Google starts penalising non-SSL sites. You also can't make a AAAA record, so no IPv6.


Put Cloudflare in front for SSL. Not sure if that makes the solution more or less complex, never worked with Route53.


As of two years ago, there was a bug with mobile safari and hash fragment preservation, which actually made using a lot of client side JS code very difficult to use directly from s3.


This is what I do on Google cloud, presumably the same. CloudFlare for ssl, google Cloud DNS, then a Google bucket. Real simple, real fast.


Yep, this is what I do for my site. 51 cents a month.


Yes. Here is a guide to deploy a React app on S3 and CloudFront (with a backend on EC2): https://stackoverflow.com/questions/41250087/how-to-deploy-a...


Inline JS and css? My first thought was that I'd rather leave the Rust part out and do what you suggest in order to deploy to static file cloud hosts.


And you can scale this so good, we do something like this with every branch/user story to test it on live environments. Supereasy, once set up.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: