Code Monkey home page Code Monkey logo

buuks-express-api's Introduction

  • 👩‍💻 Engineer @ Ushahidi
  • 🔭 Building Collabo Community
  • 😄 Gender: Obìnrin l'ọlọ́run dá mi
  • 💬 Ask me about: Software Engineering, open source, collaboration and community
  • 🌱 What am I in tech exactly? Honestly I can't pinpoint. But I can tell you I'm evolving and discovering...
  • ⚡ Fun fact(s): I'm very organised, consistency is 💯, and I love acoustic guitar

buuks-express-api's People

Contributors

ifycode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kamination

buuks-express-api's Issues

Use swagger for documenting API

It's getting harder to track sync changes to the API to the "Request body and response breakdown" section of the readme. Document the API using e.g. swagger.

Heroku deployment issues

Deployment url: https://buuks-express-api.herokuapp.com

Tested on postman.

Note: Looks like this issue occurs on Heroku when the size of the file you want to upload is large.

The issue

This happens when user is logged out: Post request to POST /books returns an html page structure instead of a response object. Also PUT /books/:bookID does this too sometimes. These are the only two endpoints I noticed does this. And they are the only two endpoints that have Cloudinary code in them... (I'm thinking it's related to cloudinary)

<!DOCTYPE html>
<html>

<head>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta charset="utf-8">
	<title>Application Error</title>
	<style media="screen">
		html,
		body,
		iframe {
			margin: 0;
			padding: 0;
		}

		html,
		body {
			height: 100%;
			overflow: hidden;
		}

		iframe {
			width: 100%;
			height: 100%;
			border: 0;
		}
	</style>
</head>

<body>
	<iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
</body>

</html>

The error message on heroku log says:

2022-03-14T17:38:57.804725+00:00 app[web.1]: �[0mPOST /books �[33m403�[0m 0.650 ms - 96�[0m
2022-03-14T17:38:58.044194+00:00 heroku[router]: sock=backend at=error code=H18 desc="Server Request Interrupted" method=POST path="/books" host=buuks-express-api.herokuapp.com request_id=94e5ec60-bbda-4f0c-819b-008d486fb7f6 fwd="105.112.16.84" dyno=web.1 connect=0ms service=239ms status=503 bytes=310 protocol=https

Expected json response

{
    "message": "You are Logged out. Please sign in to your account to continue",
    "error": "Forbidden"
}

In development i.e. with localhost, the response returns JSON response object as expected

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.