Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/satya8502/instagram_backend_api_19bce1172

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/satya8502/instagram_backend_api_19bce1172

  • v0.0.0-20211009181350-b069ff0749cc
  • Source
  • Go
  • Socket score

Version published
Created
Source

19BCE1172_Instagram_API

This is the work of S.M. Satya Sree Narayanan, Registration Number 19BCE1172. This Backend API was developed as a part of the task assigned by Appointy for internship selection.

The File Main.go contains the source code and testapi.exe is the associated exe file

All the key and value in the JSON FORMAT must be given only in lower-case and main_test.go contains the testing units

Operation-1: Creating a User

When a "POST" request for the URL "/users" comes in the function user_handle gets fired up. Inside if there is a seperate if clause that deals with the "POST" request. The details of the user to be created is given in the Body of the JSON request. IT IS NECESSARY THAT THE "KEY" IN THE KEY VALUE PAIRS IN THE JSON REQUEST BE GIVEN IN LOWER-CASE AND THE KEYS BE THE EXACT SAME KEYS GIVEN IN THE IMAGE

image

Operation-2: Getting user based on user ID

When a get request for the URL "/users" comes in the function user_handle gets fired up. Inside if there is a seperate if clause that deals with the "GET" request. The query is passed in the URL which is extracted and the user details corresponding to that ID is fetched.

Operation-3: Creating a Post

When a "POST" request for the URL "/posts" comes in the function post_handle gets fired up. Inside if there is a seperate if clause that deals with the "POST" request. The details of the user to be created is given in the Body of the JSON request. The "uid" is IT IS NECESSARY THAT THE KEY VALUE PAIRS IN THE JSON REQUEST BE GIVEN IN LOWER-CASE AND THE KEYS BE THE EXACT SAME KEYS GIVEN IN THE IMAGE

image

Operation-4: Getting a Post using the ID

When a get request for the URL "/users" comes in the function user_handle gets fired up. Inside if there is a seperate if clause that deals with the "GET" request. The query is passed in the URL which is extracted and the post details corresponding to that ID is fetched.

Operation-4: Getting a Post of a user using the USER_ID

When a get request for the URL "posts/users" comes in the function user_posts_handle gets fired up. Inside if there is a seperate if clause that deals with the "GET" request. The query is passed in the URL which is extracted and the posts details of all the posts of the user corresponding to that ID is fetched.

FAQs

Package last updated on 09 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc