Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there anything to bear in mind when hosting an API?

Tags:

jquery

api

I've created a specialised and extensive jquery application to help me develop webpages, and I've decided to release it to the world incase anyone else wants to make some use of it.

I want to save it as a hotlinkable API, but the interface uses some graphics, so basically, I have the .js file and the images all sitting in one public directory on my server.

I mean it works, and my other directories are secure, but I just want to know if there's anything else I should do?

like image 913
Starkers Avatar asked Nov 02 '22 16:11

Starkers


1 Answers

I've created a specialised and extensive jquery application to help me develop webpages, and I've decided to release it to the world incase anyone else wants to make some use of it.

Great - The world loves sharing. Why not version control your program and host it on a site such as GitHub. It's often a great way to spread popularity and you'll find people will take your program to new levels of greatness.

I want to save it as a hotlinkable API, but the interface uses some graphics, so basically, I have the .js file and the images all sitting in one public directory on my server.

Sweet. Try using a Content-Delivery Network to host allow for easy and fast access. There are some free solutions out there such as CDNJS which you could add your plugin to.

Provide minified alternatives (Google Closure could be really useful in providing extreme optimisation), and if you're using lots of images, make sure they're compressed and in sprites. You say you're application uses jQuery, but if it has an other dependencies, make them clear.

Though it takes a lot of work, having the ability to customise a plugin so that you only download what you need is a really great feature that big project such as Bootstrap and Initializr use to the joy of many. If you're hotlinking, this might not be that viable, but for plugins in general it's a really nice feature.

Finally, documentation is a must in promoting your work. Without it, your project is usually dead in the water. Websites such as GitHub again are really good at hosting documentation, and I'd point you to projects such as Select2 which demonstrate how documentation can be done correctly. If you're planning on having your documentation available across platforms, consider also using RestructuredText, as it's easy to read in Terminals and can be formatted extremely easily.

Thanks to @Blender and @nanoquack for their input

like image 105
Ian Clark Avatar answered Nov 08 '22 07:11

Ian Clark