Skip to content

Instantly share code, notes, and snippets.

View siddhuoo7's full-sized avatar
🎯
Focusing

Siddarth Ajay siddhuoo7

🎯
Focusing
View GitHub Profile
@siddhuoo7
siddhuoo7 / connector-config.txt
Created March 9, 2022 09:47 — forked from furkangencer/connector-config.txt
CDC with postgres & kafka & debezium
curl -H 'Content-Type: application/json' 127.0.0.1:8083/connectors --data '
{
"name": "example-kafka-connector",
"config": {
"connector.class": "io.debezium.connector.postgresql.PostgresConnector",
"tasks.max": "1",
"plugin.name": "wal2json",
"database.hostname": "db",
"database.port": "5432",
"database.user": "admin",

REST API Best Practices

While designing REST APIs, we need to focus on all these best practices to make your REST API the best.

Prioritize Nouns over Verbs in URI

Since REST API is mostly developed for resources like services, it is essential to use Nouns and not verbs. So it is better to use only Nouns to represent an entity in REST endpoint paths. This is because the HTTP request method already consists of verbs. So having verb in REST API endpoints will not pull any new information. You must use tags to change the resource’s state.

The following table helps you in understanding the REST API Verbs:

REST Verb Action

Introduction

REST API is an API that follows a set of rules for an application and services to communicate with each other. As it is constrained to REST architecture, REST API is referred to as RESTful API. REST APIs provide a way of accessing web services in a flexible way without massive processing capabilities.. The RESTful system is often restricted by a uniform interface, code on demand, client-server architecture, cacheability, client-server architecture, or statelessness. But this does not limit the designers because REST is merely a design approach and not a standard or framework.

Best Traits of REST API Architecture Design

  1. Easy to Work with, Easy to View: A well-grounded API will be uncomplicated to work with. Its resources and other related operations should be quickly committed to memory by developers who deal with it consistently. Thus, an ideal API should be trouble-free to read and write so that designers and developers are comfortable working with it.

  2. Tough to misuse:

@siddhuoo7
siddhuoo7 / hosts.bat
Created May 10, 2021 17:15 — forked from eveyrat/hosts.bat
windows shell script - add hosts entries
@echo off
SET NEWLINE=^& echo.
ECHO %NEWLINE%^ >>%WINDIR%\System32\drivers\etc\hosts
FIND /C /I "heracles.fila" %WINDIR%\system32\drivers\etc\hosts
IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^192.168.5.10 heracles.fila>>%WINDIR%\System32\drivers\etc\hosts
FIND /C /I "www.heracles.fila" %WINDIR%\system32\drivers\etc\hosts
@siddhuoo7
siddhuoo7 / PrometheusGrafana.yml
Last active August 13, 2020 20:31
docker-compose file for kong
version: '2.1'
networks:
monitor-net:
driver: bridge
volumes:
prometheus_data: {}
grafana_data: {}