Host Web API
-
I'd like to host a Web API for a prototype project. Free would be nice, but what's really important is 'easy'. I don't want to have to jump through hoops to publish it and maintain it. Keep it simple. Also, I'll need access a SQL DB from within it. I'm looking at AWS and Azure. Any other recommendations? Thanks
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
In my own (limited) experience, no question with the word "easy" in it should have the words "Azure" or "AWS" in the answer.
Telegraph marker posts ... nothing to do with IT Phasmid email discussion group ... also nothing to do with IT Beekeeping and honey site ... still nothing to do with IT
-
I'd like to host a Web API for a prototype project. Free would be nice, but what's really important is 'easy'. I don't want to have to jump through hoops to publish it and maintain it. Keep it simple. Also, I'll need access a SQL DB from within it. I'm looking at AWS and Azure. Any other recommendations? Thanks
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
-
I'd like to host a Web API for a prototype project. Free would be nice, but what's really important is 'easy'. I don't want to have to jump through hoops to publish it and maintain it. Keep it simple. Also, I'll need access a SQL DB from within it. I'm looking at AWS and Azure. Any other recommendations? Thanks
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
web api functions in Azure can be done in a few minutes. depends how complex the code need to be, but can write in browser, save, and is running. Cost - running cost only if called, and even then talking 1000s per 1 penny the 50$ free with account, I cant remember if that a 1 first year free things, or if have visual studio license comes with a 50$ per month with license. if .net application - similar cost of running as Function App
-
Host it yourself ! I do this a lot using Net 6 - I have a SBC on my LAN running Linux with a database(postgres) the dotnet sdk and runtimes installed, publish your API to a folder in /var/www/ (can be anywhere) , create a systemd service file and put it in /etc/systemd/system folder (so you can control it) - job done. To start it - systemctl start myapi.service, if you want it started at boot time - systemctl enable myapi.service Sample service file
\[Unit\] Description=Pete Kane Commands API net core StartLimitIntervalSec=0 \[Service\] ExecStart=/usr/bin/dotnet /var/www/CommandsAPI/CommandsAPI.dll WorkingDirectory= /var/www/CommandsAPI/ User=pjk Group=pjk Restart=on-failure SyslogIdentifier=Commands-API PrivateTmp=true \[Install\] WantedBy=multi-user.target
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
A very nice and helpful tip how simple it may be! :thumbsup: For someone with only .NET desktop experience, I'm today still staying away from the .NET back end stuff, and still a newbie. I stay still away on the old PHP solution way. :-O
Something about which we often break our head: "In the name of the Compiler, the Stack, and the Bug-Free Code. Amen." (source unknown)
-
I'd like to host a Web API for a prototype project. Free would be nice, but what's really important is 'easy'. I don't want to have to jump through hoops to publish it and maintain it. Keep it simple. Also, I'll need access a SQL DB from within it. I'm looking at AWS and Azure. Any other recommendations? Thanks
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
Azure Apps has free tier for Linux and Windows, 60 CPU minutes / day might be enough for prototyping App Service Pricing | Microsoft Azure[^]
-
I'd like to host a Web API for a prototype project. Free would be nice, but what's really important is 'easy'. I don't want to have to jump through hoops to publish it and maintain it. Keep it simple. Also, I'll need access a SQL DB from within it. I'm looking at AWS and Azure. Any other recommendations? Thanks
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
I host my own :-) About 5 years ago I pooled together about £400 gbp, and bought a second hand Dell server that was only 2 years old from a local dealer. The server was a 4 Node C6100 server, with each node/sled fully populated (8 cores and 24gb Ram + 3 1Tb drives), However, what I'm about to describe can be run on any bit of old PC hardware built within the last 10 years or so, as long as it has a CPU with virtualisation extensions added, which today is all Xeons, and most i5/i7 series. Put a decent size hard drive in the machine, download the latest Ubuntu Server LTS version (Currently 22.04 as I write this [I personally am still on 20.04]), burn the ISO to a CD or a keychain, and boot and install the PC with it. Go with the defaults, if you download the server version you should not get asked if you want a desktop or anything on it, if you do though... the answer is NO, you don't need a GUI or anything on this system, just an SSH server (Which you may also get asked if you want) Once you have the base installed, then you first want to do an update:
apt update; apt upgrade
Just to make sure everything's up to date. Following that, you want LXD installing, no point in repeating what others have written, so you you can find all you need to know here: [https://www.cyberciti.biz/faq/install-lxd-on-ubuntu-20-04-lts-using-apt/\](https://www.cyberciti.biz/faq/install-lxd-on-ubuntu-20-04-lts-using-apt/) For performance reasons on a single stand alone PC, you probably want the "snap" version, and when you init your default storage pool "btrfs" as the file system type, unless of course you want access from your host machine direct into the containers you create then your storage type wants to be "dir", the rest are for more specialist cases and require too much overhead to maintain. Once you have your Server set up, and LXD installed and initialised, then your ready to rock and roll:
lxc launch ubuntu:20.04 myfirstcontainer
Will spin up your first container running ubuntu LTS 20.04 ready for you to "lxc exec bash" into it and start adding users, software etc to it. LXD/LXC containers running ubuntu, use something called cloud-init, which allows you to add provisioning steps directly to your containers at creation time, I've already created a profile script to add to LXD and you can grab a copy from github here: [LXD Profile to add to your LXD install, allowing the creation of lightweight DOTNET 6 containers when using "lxc launch"](https://gist.github
-
I'd like to host a Web API for a prototype project. Free would be nice, but what's really important is 'easy'. I don't want to have to jump through hoops to publish it and maintain it. Keep it simple. Also, I'll need access a SQL DB from within it. I'm looking at AWS and Azure. Any other recommendations? Thanks
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
Can we get some more info? "API" is a pretty wide generic term, meaning very little by itself - What language are you looking to write it in? - Scale? Lots of parts and pieces to this, but on a simple level, there's a big difference between serving up a few thousand hits a day and a million. - DB? Accessing SQL DB - SQL Server, Postgres, MySQL/Maria? Scope again - Select only, Insert, Upsert, Delete, number of tables, linkages, etc? -Instancing? Do you need Docker containers? -Security? Need API key management? Basically, what are you trying to do? Given the last question, I found Azure to be a tad easier than AWS. For me, for proof-of-concept, I'd use a LAPP server to start. I'm partial to Postgres and most *nixes are set and forget. PHP/Postgres is good for prototyping data access. With a few tools, I could have a basic data API up and running in a few hours. Returning JSON, XML, or even an HTML block. Major clouds can all handle scale. I use PHP for prototypes, but I generally know the magnitude of scale. Even unknown, I don't concern myself much with it. I always figure if it becomes an issue, it'll be making enough money to spend the time or cost to do something different.
-
If you have a Postgres database, I can recommend Postgrest.
-
I host my own :-) About 5 years ago I pooled together about £400 gbp, and bought a second hand Dell server that was only 2 years old from a local dealer. The server was a 4 Node C6100 server, with each node/sled fully populated (8 cores and 24gb Ram + 3 1Tb drives), However, what I'm about to describe can be run on any bit of old PC hardware built within the last 10 years or so, as long as it has a CPU with virtualisation extensions added, which today is all Xeons, and most i5/i7 series. Put a decent size hard drive in the machine, download the latest Ubuntu Server LTS version (Currently 22.04 as I write this [I personally am still on 20.04]), burn the ISO to a CD or a keychain, and boot and install the PC with it. Go with the defaults, if you download the server version you should not get asked if you want a desktop or anything on it, if you do though... the answer is NO, you don't need a GUI or anything on this system, just an SSH server (Which you may also get asked if you want) Once you have the base installed, then you first want to do an update:
apt update; apt upgrade
Just to make sure everything's up to date. Following that, you want LXD installing, no point in repeating what others have written, so you you can find all you need to know here: [https://www.cyberciti.biz/faq/install-lxd-on-ubuntu-20-04-lts-using-apt/\](https://www.cyberciti.biz/faq/install-lxd-on-ubuntu-20-04-lts-using-apt/) For performance reasons on a single stand alone PC, you probably want the "snap" version, and when you init your default storage pool "btrfs" as the file system type, unless of course you want access from your host machine direct into the containers you create then your storage type wants to be "dir", the rest are for more specialist cases and require too much overhead to maintain. Once you have your Server set up, and LXD installed and initialised, then your ready to rock and roll:
lxc launch ubuntu:20.04 myfirstcontainer
Will spin up your first container running ubuntu LTS 20.04 ready for you to "lxc exec bash" into it and start adding users, software etc to it. LXD/LXC containers running ubuntu, use something called cloud-init, which allows you to add provisioning steps directly to your containers at creation time, I've already created a profile script to add to LXD and you can grab a copy from github here: [LXD Profile to add to your LXD install, allowing the creation of lightweight DOTNET 6 containers when using "lxc launch"](https://gist.github
It's apt update not apt install update same for upgrade
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
-
I'd like to host a Web API for a prototype project. Free would be nice, but what's really important is 'easy'. I don't want to have to jump through hoops to publish it and maintain it. Keep it simple. Also, I'll need access a SQL DB from within it. I'm looking at AWS and Azure. Any other recommendations? Thanks
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
I have never done anything like that, but perhaps this helps: Penny Pinching in the Cloud: Azure Static Web Apps are saving me money - Scott Hanselman's Blog[^] and from that: Azure Static Web Apps – App Service | Microsoft Azure[^] "Pay as you grow Always free for hobby/personal projects. Easily move between pricing options based on your business needs."
-
It's apt update not apt install update same for upgrade
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
aye, so a minor keyboard slip occured... meh...
-
I'd like to host a Web API for a prototype project. Free would be nice, but what's really important is 'easy'. I don't want to have to jump through hoops to publish it and maintain it. Keep it simple. Also, I'll need access a SQL DB from within it. I'm looking at AWS and Azure. Any other recommendations? Thanks
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
For the prototype of my project, I am using DreamCompute from DreamHost. I pay under $40 per month. I'm using Rust with the actix_web crate to build out the API, packaging it in a Docker container, and using Nginx for routing and reverse proxying. MySql is the DB. So far, so good.
-
aye, so a minor keyboard slip occured... meh...
It was a minor obervation Pete :)
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
-
It was a minor obervation Pete :)
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
Ya I know.... :-) You just caught me on the back of dealing with some woke idiots on Quora :-) sa'll good.