Tumgik
#web api development
step2gen · 6 days
Text
Creating efficient, scalable, and maintainable web APIs is crucial in the dynamic world of web development. Design patterns play a significant role in achieving these goals by providing standardized solutions to common problems. One such design pattern that stands out is REPR, which focuses on the representation of resources consistently and predictably. By adhering to the REPR design pattern, developers can create APIs that are not only easy to use but also robust and adaptable to future changes. Read more...
0 notes
geek-cc · 2 years
Text
0 notes
hayacode · 4 months
Text
You probably already know about this but in case you don’t know (like me)
here is a link to many public APIs that you could use in your projects 👩🏻‍💻✨
https://github.com/public-apis/public-apis
38 notes · View notes
codemerything · 1 year
Text
Introduction to APIs and Web APIs
The illustration above is the best way you can think of how APIs work and I talk more about it in my new article about APIs. I really love the concept and logic of APIs, it proves that collaboration is a huge part of programming and APIs solidify that. I hope you enjoy the read and also this is my first article and I intend to write more about technologies that interest me and maybe tips and tricks in the future.
111 notes · View notes
anndcodes · 1 year
Text
Tumblr media Tumblr media Tumblr media Tumblr media
03/10/23
i finished shecodes week 5 homework, and now the app we're building has real-time temperature, as well as description of temperature, humidity and wind! you can search the city or you can get temperature of your current location!! this is really cool!
learning about api has being really exciting, so i made a simple page using meow-facts api where you click meow to get facts about cats, you can check the repository and the live page!
really excited to learn more about api!
ps: this sakura chocolate is the cutest thing! i almost didn't eat it 🥺
48 notes · View notes
code-es · 1 year
Text
Color scheme picker!
Tumblr media
working on a color picker that gives you a scheme for the given color using color api! I am getting the colors now, and now I just need to display them hehe
Tumblr media
As for as UI goes, this is a very lofi prototype of what I'm imagining
Tumblr media
if you see something in my code that makes you go "oh my god that is terrible practice pls never do that" feel more than free to point it out lol, I'd just be happy
48 notes · View notes
guzscode · 2 months
Text
Do You Want Some Cookies?
Doing the project-extrovert is being an interesting challenge. Since the scope of this project shrunk down a lot since the first idea, one of the main things I dropped is the use of a database, mostly to reduce any cost I would have with hosting one. So things like authentication needs to be fully client-side and/or client-stored. However, this is an application that doesn't rely on JavaScript, so how I can store in the client without it? Well, do you want some cookies?
Why Cookies
I never actually used cookies in one of my projects before, mostly because all of them used JavaScript (and a JS framework), so I could just store everything using the Web Storage API (mainly localstorage). But now, everything is server-driven, and any JavaScript that I will add to this project, is to enhance the experience, and shouldn't be necessary to use the application. So the only way to store something in the client, using the server, are Cookies.
TL;DR Of How Cookies Work
A cookie, in some sense or another, is just an HTTP Header that is sent every time the browser/client makes a request to the server. The server sends a Set-Cookie header on the first response, containing the value and optional "rules" for the cookie(s), which then the browser stores locally. After the cookie(s) is stored in the browser, on every subsequent request to the server, a Cookie header will be sent together, which then the server can read the values from.
Pretty much all websites use cookies some way or another, they're one of the first implementations of state/storage on the web, and every browser supports them pretty much. Also, fun note, because it was one of the first ways to know what user is accessing the website, it was also heavy abused by companies to track you on any website, the term "third-party cookie" comes from the fact that a cookie, without the proper rules or browser protection, can be [in summary] read from any server that the current websites calls. So things like advertising networks can set cookies on your browser to know and track your profile on the internet, without you even knowing or acknowledging. Nowadays, there are some regulations, primarily in Europe with the General Data Privacy Regulation (GDPR), that's why nowadays you always see the "We use Cookies" pop-up in websites you visit, which I beg you to actually click "Decline" or "More options" and remove any cookie labeled "Non-essential".
Small Challenges and Workarounds
But returning to the topic, using this simple standard wasn't so easy as I thought. The code itself isn't that difficult, and thankfully Go has an incredible standard library for handling HTTP requests and responses. The most difficult part was working around limitations and some security concerns.
Cookie Limitations
The main limitation that I stumbled was trying to have structured data in a cookie. JSON is pretty much the standard for storing and transferring structured data on the web, so that was my first go-to. However, as you may know, cookies can't use any of these characters: ( ) < > @ , ; : \ " / [ ] ? = { }. And well, when a JSON file looks {"like":"this"}, you can think that using JSON is pretty much impossible. Go's http.SetCookie function automatically strips " from the cookie's value, and the other characters can go in the Set-Cookie header, but can cause problems.
On my first try, I just noticed about the stripping of the " character (and not the other characters), so I needed to find a workaround. And after some thinking, I started to try implementing my own data structure format, I'm learning Go, and this could be an opportunity to also understand how Go's JSON parsing and how mostly struct tags works and try to implement something similar.
My idea was to make something similar to JSON in one way or another, and I ended up with:
Tumblr media
Which, for reference, in JSON would be:
Tumblr media
This format is something very easy to implement, just using strings.Split does most of the job of extracting the values and strings.Join to "encode" the values back. Yes, this isn't a "production ready" format or anything like that, but it is hacky and just a small fix for small amounts of structured data.
Go's Struct Tags
Go has an interesting and, to be honest, very clever feature called Struct Tags, which are a simple way to add metadata to Structs. They are simple strings that are added to each field and can contain key-value data:
Tumblr media
Said metadata can be used by things such the encoding/json package to transform said struct into a JSON object with the correct field names:
Tumblr media
Without said tags, the output JSON would be:
Tumblr media
This works both for encoding and decoding the data, so the package can correctly map the JSON field "access_token" to the struct field "Token".
And well, these tokens aren't limited or some sort of special syntax, any key-value pair can be added and accessed by the reflect package, something like this:
Tumblr media Tumblr media
Learning this feature and the reflect package itself, empowered me to do a very simple encoding and decoding of the format where:
Tumblr media
Can be transformed into:
Tumblr media
And that's what I did, and the [basic] implementation source code just has 150 lines of code, not counting the test file to be sure it worked. It works, and now I can store structured data in cookies.
Legacy in Less Than 3 Weeks
And today, I found that I can just use url.PathEscape, and it escapes all ( ) < > @ , ; : \ " / [ ] ? = { } characters, so it can be used both in URLs and, surprise, cookie values. Not only that, but something like base64.URLEncoding would also work just fine. You live, and you learn y'know, that's what I love about engineering.
Security Concerns and Refactoring Everything
Another thing that was a limitation and mostly worry about me, is storing access tokens on cookies. A cookie by default isn't that secure, and can be easily accessed by JavaScript and browser extensions, there are ways to block and secure cookies, but even then, you can just open the developer tools of the browser and see them easily. Even though the only way to something malicious end up happening with these tokens are if the actual client end up being compromised, which means the user has bigger problems than just a social media token being leaked, it's better to try preventing these issues nonetheless (and learn something new as always).
The encryption and decryption part isn't so difficult, Go already provides packages for encryption under the crypto module. So I just implemented an encryption that cyphers a string based on a key environment variable, which I will change every month or so to improve security even more.
Doing this encryption on every endpoint would be repetitive, so adding a middleware would be a solution. I already made a small abstraction over the default Go's router (the DefaultMuxServer struct), which I'm going to be honest, wasn't the best abstraction, since it deviated a lot from Go's default HTTP package conventions. This deviation also would difficult the implementation of a generic middleware that I could use in any route or even any function that handles HTTP requests, a refactor was needed. Refactoring made me end up rewriting a lot of code and simplifying a lot of the code from the project. All routes now are structs that implement the http.Handler interface, so I can use them outside the application router and test them if needed; The router ends up being just a helper for having all routes in a struct, instead of multiple mux.HandleFunc calls in a function, and also handles adding middlewares to all routes; Middlewares end up being just a struct that can return a wrapped HandlerFunc function, which the router calls using a custom/wrapped implementation of the http.ResponseWriter interface, so middlewares can actually modify the content and headers of the response. The refactor had 1148 lines added, and 524 removed, and simplified a lot of the code.
For the encryption middleware, it encrypts all cookie values that are set in the Set-Cookie header, and decrypts any incoming cookie. Also, the encrypted result is encoded to base64, so it can safely be set in the Set-Cookie header after being cyphered.
---
And that's what I worked in around these last three days, today being the one where I actually used all this functionality and actually implemented the OAuth2 process, using an interface and a default implementation that I can easily reimplement for some special cases like Mastodon's OAuth process (since the token and OAuth application needs to be created on each instance separately). It's being interesting learning Go and trying to be more effective and implement things the way the language wants. Everything is being very simple nonetheless, just needing to align my mind with the language mostly.
It has been a while since I wrote one of these long posts, and I remembered why, it takes hours to do, but it's worth the work I would say. Unfortunately I can't write these every day, but hopefully they will become more common, so I can log better the process of working on the projects. Also, for the 2 persons that read this blog, give me some feedback! I really would like to know if there's anything I could improve in the writing, anything that ended up being confusing, or even how I could write the image description for the code snippets, I'm not sure how to make them more accessible for screen reader users.
Nevertheless, completing this project will also help to make these post, since the conversion for Markdown to Tumblr's NPF in the web editor sucks ass, and I know I can do it better.
2 notes · View notes
beproblemsolver · 4 months
Text
Tumblr media
Learn to create a REST API with Laravel and Postman in 9 straightforward steps. Follow our guide to efficiently build and test powerful APIs Read More: https://beproblemsolver.com/rest-api-with-laravel-and-postman/
4 notes · View notes
Text
Power of Natural Language Processing with AWS
Dive into the world of Natural Language Processing on AWS and learn how to build intelligent applications with services like Amazon Comprehend, Transcribe, and Polly. Explore the future of language-driven AI and cloud computing #AWSNLP #AI #CloudComputing
Natural Language Processing (NLP) has emerged as a transformative force in the realm of artificial intelligence, enabling computers to comprehend and generate human-like text. As businesses increasingly recognize the value of language-driven insights and applications, cloud platforms such as Amazon Web Services (AWS) have played a pivotal role in democratizing access to advanced NLP capabilities.…
Tumblr media
View On WordPress
5 notes · View notes
acemerotechnologies · 6 months
Text
Tumblr media
Acemero is a company that strives for excellence and is goal-oriented. We assist both businesses and individuals in developing mobile and web applications for their business.
Our Services include:
Web/UI/UX Design
CMS Development
E-Commerce Website
Mobile Apps
Digital Marketing
Branding
Domain & Hosting
API Integration
Our Products include :
Support Ticket System
Direct Selling Software
Learning Management System
Auditing Software
HYIP Software
E-Commerce Software
2 notes · View notes
alpinesoft-blog · 6 months
Text
Transform Your Business with Custom Mobile Apps 🚀
https://www.youtube.com/watch?v=cfLOrUiFZKQ Please like share & subscribe
2 notes · View notes
step2gen · 1 month
Text
In the world of software, APIs (Application Programming Interfaces) act as bridges between different services. They help applications talk to each other by sending requests and receiving responses. Think of them as messengers, delivering messages between clients (like apps or websites) and servers (where data or actions are stored). Read more...
1 note · View note
newsdataapi · 1 year
Text
In today's world creating a website and application has become very easy with the use of APIs. With the APIs, you can integrate your website or applications with other sources. Here we have a list of Top Free APIs you can use in your APP development.
4 notes · View notes
fretzine · 2 years
Text
API Development
This week I have been developing my knowledge of using APIs within my web app using the javascript Fetch API. In the small app below I have used the dictionary API (which is free, link below):
Free Dictionary API
This very basic API returns a JSON with a meaning of the world and audio snippet of how to pronounce the word. I followed along to a very good tutorial on YouTube to help build this app which is here:
(43) JavaScript Project in 5 min - English Dictionary Project #HTML, #CSS and #JavaScript - YouTube
You can see the finished product below:
Tumblr media Tumblr media
As you can see this is a very good example of working with a very basic API. It basically returns a JSON object which we then turn into an iterable JS object with the .json() method. You can see a snippet of the script below:
Tumblr media
Once we have generated an object we can point to the data within its arrays and assign it to the innerText or 'src' (audio) of the website's elements.
Some further learning required to understand exactly how this works is:
Promises
Async functions
Await
Although this is basic I plan to go to Rapid API and look through the various free APIs available and build a bigger application that requires API keys, options which are included within the API calls header.
More to follow.
4 notes · View notes
ceyhanmedya · 2 years
Text
Discord
New Post has been published on https://hazirbilgi.com/what-is-discord-what-does-it-do-how-to-use-discord/
Discord
What is Discord? What Does It Do? How to Use Discord
Discord was designed in 2015 as a community building and instant messaging, audio or video calling and digital distribution platform between users.
The Discord app is available for Windows, macOS, Linux, Android or a web browser.
Discord currently has more than 140 million active users.
How to Use Discord
Discord is designed for members to communicate with each other based on text, audio or video.
Each community  is called a server . These servers  contain channels . While only text-based chat can be used in text channels, voice chat feature can be used in voice-based channels. In addition, previews of links, images, YouTube videos and more can be shared from the chat line.
Under each server, there are channels with certain rules. For example, a chat channel may be open to conversations about the game , while another chat channel may be used only for cat pictures. There is no limitation in this regard.
In Discord, which contains tens of thousands of servers, a  Discord channel can be found according to a user’s interest .
Is Discord Paid?
Discord is completely free to use, create servers or join other servers  . Also,  the Discord Nitro feature is available for $9.99 per month or $99.99 per year.
Recently, Discord also announced localized prices for Turkey.
Discord Nitro price for Turkey was determined as 26.99 Turkish Liras per month  . It can also be purchased for 269.99 Turkish Liras per year  .
What are Discord Nitro Features?
Discord Nitro features that can be purchased with monthly and annual packages are listed below.
Better sound quality for audio channels.
Community emoji gallery with up to 250 emojis.
Increased quality for live broadcasts.
Higher upload  capacity for everyone on the server.
Customizable server URL.
Customizable server banner.  
How to Use Discord
First of all, the version published according to the operating system of the device  (Windows, iOS, Mac, etc.) should be downloaded from the download channels of Discord.
Download link:  https://discord.com/download
A Discord account must be created for free after the download and installation is complete  .
Account creation link:  https://discord.com/register
It is recommended that you choose a valid email address and a strong password when creating an account. You may want to enable two-step verification as an additional account security measure.
Official guide for 2-step verification:  https://support.discord.com/hc/en-us/articles/219576828-Setting-up-Two-Factor-Authentication
You can access the settings page by pressing the gear button on the lower left side of the home page and all kinds of settings can be made on this page. In the Settings tab, settings related to privacy, audio, video and other application can be made. In order to stay safe,  the “Keep me safe” option can be selected from  the “Privacy and Security” section . All incoming messages with this setting will be scanned by Discord and reach you. From the Settings tab, you can easily configure many more settings such as who can add you, who can message you.
Is Discord Safe?
With the right privacy setting and monitoring, Discord is completely safe. The easiest way to stay safe on Discord is to only accept friend requests from people you really know and log into community servers you know.
If you are a parent, it is recommended to monitor your child’s Discord activities. Parents and children should know how to act in cases of abuse or abuse, although server moderators usually respond quickly to such incidents on their respective servers.
With a simple privacy setting and careful friend selection, Discord is completely secure.
discord,discord login,discord download,discord on xbox,discord app,discord server,is discord down,betterdiscord,discord web,discord developer portal,discord account,discord activities,discord api,discord active developer badge,discord auth code,discord apk,discord app download,discord account disabled,discord alternatives,apex legends discord,
2 notes · View notes
reactzestgeek · 2 years
Link
A leading ReactJs development company, we provide Reactjs development for your needs. Hire ReactJS developers to get cost-effective services.
4 notes · View notes