GithubHelp home page GithubHelp logo

daemon1024 / paste.land Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 5.0 23 KB

Paste tool made in deno

Home Page: https://paste-land.herokuapp.com/

License: MIT License

TypeScript 82.65% HTML 17.35%
deno pastebin typescript restful-api heroku curl

paste.land's People

Contributors

aayushmau5 avatar daemon1024 avatar reapedjuggler avatar ssgshubham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

paste.land's Issues

API Usage on root endpoint

Currently the API returns "Hello World!" on GET /
Instead it should return the full list of how to use the API.

Directions/Approach

ctx.response.body = "Hello World!";

The "Hello World!" string here should be replace with appropriate text.

If it is the first time that you contribute to the project, follow these steps:

Write a comment in this issue thread to let other possible contributors know that you are working on this bug. For eg : Hey all, I would like to work on this issue., follow Contributing to the project🔥✨ and feel free to ask anything related to this issue ✌️

Use persistent storage for pastes

Currently the API stores the paste in an pastes variable which is resets everytime you launch the server.
We need to configure a persistent storage preferably a database.

If it is the first time that you contribute to the project, follow these steps:

Write a comment in this issue thread to let other possible contributors know that you are working on this bug. For eg : Hey all, I would like to work on this issue., follow Contributing to the project🔥✨ and feel free to ask anything related to this issue ✌️

Add API method for DELETE paste

Add an API Method so that one can delete the paste that was created earlier.

  • DELETE /:id - Delete the paste with the given id.

Directions/Approach

Add router.delete('/',deletefunction) in mod.ts

If it is the first time that you contribute to the project, follow these steps:

Write a comment in this issue thread to let other possible contributors know that you are working on this bug. For eg : Hey all, I would like to work on this issue., follow Contributing to the project🔥✨ and feel free to ask anything related to this issue ✌️

Document DELETE in README

A method to DELETE a paste was implemented in #8. We just need to document it in our README like other methods.

Add github templates

Add issue templates and pull request templates to the repository.

Reference

If it is the first time that you contribute to the project, follow these steps:

Write a comment in this issue thread to let other possible contributors know that you are working on this bug. For eg : Hey all, I would like to work on this issue., follow Contributing to the project🔥✨ and feel free to ask anything related to this issue ✌️

Add parsing for various Content-type

Currently the API only accepts text/plain as it's content type. The API needs to be able to parse other content types like application/json and application/x-www-form-urlencoded

Some hints on how to implement this can be taken from https://github.com/oakserver/oak/blob/main/examples/routingServer.ts#L50-L67

If it is the first time that you contribute to the project, follow these steps:

Write a comment in this issue thread to let other possible contributors know that you are working on this bug. For eg : Hey all, I would like to work on this issue., follow Contributing to the project🔥✨ and feel free to ask anything related to this issue ✌️

Use a randomly generated hash/string for id's

We are using an integer which increments after each paste as the id for the paste. This is not the right way to generate the id.
We need it to be a randomly generated id, something like b7ckgse8c which is entirely composed a-z,A-Z and 0-9. We can further discuss the specifics of the random id if you are interested.

Move all the API methods to a new directory

Currently all the API methods are present in mod.ts itself. This will hinder the readability of the code once there are more methods.
We need to create a different directory and add all the API methods in it.

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.