Git Product home page Git Product logo

p's Introduction

P

yes, it's just called P as in ฯ€ because I'm suck at naming things

A website where you can paste code and save it. It's basically like a pastebin clone I don't know how else I would explain it.

This is meant to run on a Cloudflare Worker and it uses Cloudflare KV to store the pasted text. The paste result will expires after 7 days to save space.

You can give the url a suffix like a filename and it will highlight them accordingly using highlight.js. Currently it only support these languages because I intend to use this for my personal needs. It's also reduces the bundle size if I don't import languages that I don't use.

  • Typescript/Javascript
  • HTML, XML
  • CSS
  • Markdown
  • JSON
  • PHP
  • Go
  • Rust
  • Java
  • C#
  • C++
  • Dart
  • Python
  • Dockerfile
  • SQL

I also tried to apply clean architecture for this project. Might be a bit overkill, but I like it overall. Of course it wouldn't be perfect since this is the first time I tried to apply clean architecture so any feedback is more than welcome!

Please don't copy any sensitive information to this website. It's not encrypted and I can definitely see what you paste :p

Development

If you want to develop this project, make sure you have the wrangler CLI installed. You can install it using npm or cargo by running these commands.

# npm
npm i -g wrangler

# cargo
cargo install wrangler

Make sure you make a file called wrangler.toml based on the example file in this repo and fill the appropriate values. Refer to the Cloudflare KV Namespace Documentation for more information about how to set up the namespace.

Then you can run the following command to start the dev server.

wrangler dev src/index.ts

This project is built using esbuild and tested using vitest.

Self Deploy

You can deploy this project to your own instance of Cloudflare Worker using the following command in the project root directory. Make sure you filled the wrangler.toml file with the appropriate values.

wrangler publish

If you don't like the defaults such as supported languages, the highlighter, where the pasted text is stored, you can of course adjust them to your likings.

License

This project is licensed under the MIT License.

p's People

Contributors

elianiva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

p's Issues

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.