Giter Club home page Giter Club logo

restfox's Introduction

Restfox

Restfox

Web App | Install | Releases/Downloads | Screenshots | Docs | Compiling | Compiling Web Standalone

Offline-First Minimalistic HTTP & Socket Testing Client for the Web & Desktop

Watch video to see plugins in action:

Installation

macOS

Package available in homebrew by using:

brew install restfox

Ubuntu and other distributions supporting snap

Package available through snap can be installed using:

sudo snap install restfox

RPM, DEB and NuPKG

There are precompiled binaries in the releases page.

Windows

scoop bucket add extras
scoop install restfox

There are also precompiled binaries in the releases page.

docker run --name Restfox -d -p 4004:4004 flawiddsouza/restfox:0.18.0

Start webapp using docker compose

docker-compose up -d

Start webapp using docker compose with custom port

docker-compose -p 5000:4004 up -d

Start webapp using docker compose with different version

RESTFOX_VERSION=0.18.0 docker-compose up -d

Screenshots

Response History

Context Menu

Environment Variables

Plugins

Compiling

ui

Development

npm run dev

Distribution

npm run build

Desktop distribution and development

npm run build-desktop

Web Standalone distribution and development

npm run build-web-standalone

To upgrade codemirror to latest version

npm i @codemirror/autocomplete@latest @codemirror/commands@latest @codemirror/lang-javascript@latest @codemirror/lang-json@latest @codemirror/language@latest @codemirror/search@latest @codemirror/state@latest @codemirror/view@latest

electron

To upgrade electron to latest version

npm install --save-dev electron@latest @electron-forge/cli@latest @electron-forge/maker-deb@latest @electron-forge/maker-rpm@latest @electron-forge/maker-squirrel@latest @electron-forge/maker-zip@latest @electron-forge/maker-flatpak@latest @electron-forge/publisher-github@latest electron-builder@latest

Development

npm run start

Distribution

npm run make

or

npm run publish

Development

npm run dev

Distribution

npm run build

Using web-standalone

git clone https://github.com/flawiddsouza/Restfox
cd Restfox/packages/ui
npm i
npm run build-web-standalone
cd ../web-standalone
npm i
npm start

By default npm start will run Restfox at port 4004. You can override the port by passing port like so PORT=5040 npm start.

Docker Build Instructions

First refer to Compiling Web Standalone to build successfully locally and use it normally. Then in the project root directory (directory with Dockerfile), execute:

docker build -t restfox:xx .

Note: xx is the version number

After the build is complete, use the following command to start the service:

docker run -d -p:4004:4004 restfox:xx

Visit after successful startup: localhost:4004

Alternatively, you can also use the pre-built Docker image available on Docker Hub. See: Docker.

restfox's People

Contributors

azvyae avatar boscodomingo avatar donuts-are-good avatar drphil avatar eznix86 avatar flawiddsouza avatar iuv avatar jaybz avatar jsoref avatar kobenguyent avatar luckytea avatar mofazhe avatar nampnq avatar neuronenix avatar skoro avatar sprive avatar tha14 avatar zuramai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

restfox's Issues

Postman Import

It would be ideal to have a feature to import existing postman collections and environments

GET Request made through Restfox return empty body at express router

I made the same GET request with Restfox and POSTMAN.

As I access req.body at the backend, the former one return {} and the later return {"role":"root"}.
I tried body-parser, but it didn't work for my case.

method GET
request http://127.0.0.1:9000/user/list`
header {"Content-Type": "application/json"}
body {"role":"root"}

Update comment
After some googling and also try out some other alternative software for this API testing. I come to realize, body part is typically not sent on GET request. An option to enable body part on GET request might be a sweet spot, but for now I will settle with the norms which is utilizing the params part.

// server.js
import express from "express";

var app = express();

app.set("title", "GATE");
app.set("view engine", "ejs");
app.use(express.json());

var router = express.Router();

router.get("/", (req, res) => {
console.log(req.body);
res.end("END");
});
// package.json
"dependencies": {
    "axios": "^1.2.3",
    "bcrypt": "^5.1.0",
    "body-parser": "^1.20.1",
    "cookie-parser": "^1.4.6",
    "ejs": "^3.1.8",
    "express": "^4.18.2",
    "express-session": "^1.17.3",
    "http": "^0.0.1-security",
    "jsonwebtoken": "^9.0.0",
    "md5": "^2.3.0",
    "mysql": "^2.18.1",
    "nodemailer": "^6.9.0",
    "request": "^2.88.2",
    "sha2": "^1.0.2"
  }

CTRL+Left and CTRL+Right are not handled by focused text input boxes

When text input boxes are focused, CTRL+Left and CTRL+Right switches tabs instead of moving 1 word to the left/right. I've observed this behavior in the Request URL field, JSON/Plain Text Body, and the request rename input boxes (both via double-click or right-click->properties)

Import CURL request

Hi,
I am not able to import CURL request in REST fox. is there any option?

Add Path Parameters

Great work on Restfox! Love it.

Feature request:
Ability to easily add path parameters instead of query parameters.

In Postman you can add a path parameter by using ":" instead of "{{}}" for environment variables.

image

Restfox empty screen

When I open the restfox today, I find the screen empty with all my requests gone. Attaching screenshot of dev tools. Could you please help

image

image

Add search feature to response preview pane

The response preview pane is not quite searchable with browser's built-in find feature. I tried this in Firefox and Chrome, and although they behave somewhat differently, I can't fully search responses that are long using CTRL+F on either browser. I'm guessing this is because Restfox lazy loads the contents of the preview pane. The lazy loading behavior helps Restfox be fast and lightweight so I wouldn't want to change that behavior just to "fix" the browser's built-in find, but it would be nice if Restfox provided a way to search the response without changing the lazy loading behavior. This can be worked around easily by copy-pasting the response to a text editor so this is just a nice-to-have feature though.

gRPC support

Would love to hear if there is a reasonable avenue for gRPC support. Postman released this feature a year back and its been a game changer for protobuf based apps. With that said Postman has gotten so heavy that I don't want to use it anymore if something lightweight like this exists.

Support for using NodeJS libraries in plugins

The specific use case I have for this is for using CryptoJS to generate time-based HMAC keys for inclusion in authentication header(s). I'm not sure if there's a good way to implement this such that users can specify the libraries for themselves. But that would be preferable over having to build a set of NodeJS libraries into Resfox itself.

Environment Coloration

The Environment Dropdown is easily Missed at first glance. I suggest implementing a simple Coloration of the Menu bar based on Environment chosen. This can be as simple as custom hex coloration, or randomly assigned colors on creation of an environment. So it is easy at first glance to determine the environment you are in.

Crash on fresh install

Im unsure how you will be able to replicate this. But I have just done a first time install, created a request, but when I click the auth dropdown, there are no options in it and the app freezes up completely.

Copy request as curl

Hello! Is it possible to copy a request as a curl script? That would let me send interesting HTTP requests to my colleagues, some of whom are hardcore CLI junkies :)

I could write a script to format the exported JSON into a curl call, but it would be much more convenient to have "Export > copy current request as curl" work (or perhaps a right click somewhere).

Anyway, thanks for restfox! I really like it so far!

OpenAPI Imports

While it's great to be able to import Postman data, I would say that probably half of the things I'm typically importing into Postman are actually OpenAPI files. I would love to see OpenAPI import support in this tool so that I can say goodbye forever to Postman.

Support for setting environment variables in plugins

An example use case would be for authentication schemes where a token is returned as part of the request. The same token then has to be included in every header for subsequent requests until the token expires.

Based on my own use cases, setting environment variables temporarily works. By temporary, I mean values only persist in the current "session" but not when you close the browser window and re-open it. There may be use cases that need the values to persist across sessions though.

I am trying to find a workaround for my use case by using an object within the plug-in's scope that is persisted across requests, but I haven't found such an object yet.

Broken characters in export file dialog

When I click on the "Export" button, the characters seem to be broken:

image

I am on Ubuntu 23.04 and use:

$ snap info restfox
name:      restfox
summary:   Lightweight REST / HTTP Client
publisher: Artelin (flawid)
store-url: https://snapcraft.io/restfox
license:   unset
description: |
  A lightweight REST / HTTP Client based on Insomnia and Postman.
  
  Features:
  - Workspaces
  - Tabs
  - Nested Folders
  - Lots of context menus
  - Response history
  - Plugins
  - GraphQL support
  - Import collections exported from Postman and Insomnia
  - Simple user friendly interface
commands:
  - restfox
snap-id:      5F3RdI1tJO2Fj4oHj05gtSmT7osdZmDm
tracking:     latest/stable
refresh-date: today at 08:01 CEST
channels:
  latest/stable:    0.1.0 2023-09-28 (13) 80MB -
  latest/candidate: ↑                          
  latest/beta:      ↑                          
  latest/edge:      ↑                          
installed:          0.1.0            (13) 80MB -

Having `brew install restfox` would be nice

I think having single command installs would result in few benefits

  • more users
  • upgrades
  • most of the users running the latest version
    • security patches
    • you could assume issues are about current version
  • retention of users. I use brewfile to keep track of things I want to keep between os reinstalls

From top of my head on mac there is brew/nix-darwin, win has choco maybe others and on linux all of the million package managers currently in use + snap.

Save binary response as file

First of all: this is great tool! Postman forced me to switch as they discontinue the Scratchpad. Restfox works like a charm ;-).

I miss one Postman feature: in my API, I have an endpoint that returns binary data (e.g. an image). Restfox displays the raw data.

Could you add the postman feature to save it as file? Here is Postman screenshot:
postman_save_response

My service also sets the "Content-Disposition" header with a filename (it is generated by C# code):
attachment; filename=dispositionservicerest_restfox_gettoken1_net6.png; filename*=UTF-8''dispositionservicerest_restfox_gettoken1_net6.png
This filename could be defaulted to the "Save as" dialog.

Postman also supports "Save to file" for JSON responses, where a filename "response.json" is defaulted.

Graphql Schema

I'm one of those abandoning ship from insomnia after years of love for the product. Coming here i can see Restfox covers almost everything i want. I did, however, find that while Graphql works great, i couldn't see a schema for the endpoints i used. This is one thing i find very handy. Am i overlooking it or is there no plan to have it at the moment?

Unclear on the purpose of the tabs

It seems a request can have at most one tab open. As such, when working with a few requests, the tabs appear to duplicate the function of the collection in the sidebar.

I imagine the benefit of this is that when you have a lot of requests in a collection, the tabs serve as a "working set" of requests. However for my use case, I find the duplication unhelpful.

(Great app btw, thank you)

Support bulk-editing headers

In Postman you can edit headers in bulk, which is very useful in cases where you want to paste the headers of a previous request and amend the body, for example. In Restfox you have to insert the headers one by one.

image

I don't expect this would be too difficult to add. You'd just need to parse the line-separated headers in a textbox and update your list of headers.

Add option to opt out of tracking

When you load Restfox in the browser, upon inspecting the network tab in the developer tools, a request to umami.artelin.dev/umami-analytics.js can be seen.

Umami is a well known analytics tool and even though there is no shame in tracking user behavior in your application to understand better how customers are using your product, we should both let the user know that they are being tracked as well as giving them the option to not be tracked if they so desire.

Shortcuts support

Add common shortcuts from Postman and implement an interface for displaying them

Allow enabling/disabling plugins on a per-workspace, per-folder, or per-request basis

For some of my use cases at least, plugins will need to be be specific to a project only and may break requests meant for other projects. The workaround for this is to code the plugin to allow disabling/enabling execution via environment variables, however, the per-workspace/folder/request feature is a far cleaner solution.

Alternatively, being able to create plugins specific to a workspace/folder/request might be better, but I'm not sure how that work work UI-wise. Maybe moving the plugins to the request tab and right-click menu or creating a separate plugin-like feature there might work.

edit: Sorry, lots of edits. I wasn't able to collect all my thoughts before posting this. Hopefully this is the last one.

Support mobile browser

It would be awesome to have support for mobile browsers as well.

As of now the UI is not scalable on mobile.

Screenshot_20221022-005534_Brave.jpg

Support for form-data

Have a use case to use form-data where I need to upload a file in the request as part of body. Going by the options in dropdown, looks like form-data is not supported.

image

Could you please help

Support for team collaboration

Syncing requests and environments across teams with Git would be an awesome feature. It's keeping me away from using Restfox instead of Postman. This could be easily set up with a GitHub repo Restfox manages and reads from, and all team members must have access to. You simply ask to log in via GitHub and voilá

Beautify JSON does not work if unquoted variables are used in the Body

Beautify JSON does not work with the following JSON Body for example:

{
    "requestObject": {
        "requestType": "requestType1","targetId": {{ TestTargetId }}
    }
}

Enclosing {{ TestTargetId }} in quotes will allow Beautify to work. This workaround is fine for endpoints that do not distinguish between numeric and string types, but not so for endpoints that do have behavioral differences when numeric values are passed as a string vs numeric type.

Local edit/read file

It would be awesome if restfox instead of using the import/export boring feature, to set some way to make the changes be actual read and edit in a local file.
This makes the "Giting" a lot more easy...

Wrong Content-Type header

on POST method, I set the Body to 'Form URL Encoded' and I add the header "Content-Type" : "application/x-www-form-urlencoded" but the restfox sends header "Content-Type" : "text/plain;charset=UTF-8" which is wrong

Version: v0.0.8
Installation: Using web-standalone
node: v18.16.1
os: Rocky Linux release 9.2

Setting cookies

Hello,

is there a way to set cookies? Maybe a plugin could be enabled to write cookie values?

thanks

running web standalone behind Traefik reverse proxy with the docker hub image

image

version: "3.9"
  
services:
  restfox:
    image: flawiddsouza/restfox:0.0.8

    deploy:
      replicas: 1
      placement:
        constraints:
##          - node.labels.role == db
#          - node.hostname == macmini1
          - node.labels.mac-rack == true
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.restfox.tls=true"
        - "traefik.http.services.restfox.loadbalancer.server.port=4004"
        - "traefik.http.routers.restfox.rule=Host(`restfox.nixc.us`)"
        - "traefik.http.routers.restfox.entrypoints=websecure"
        - "traefik.http.routers.restfox.tls.certresolver=letsencryptresolver"
        - "traefik.http.routers.restfox.service=restfox"
        - "traefik.docker.network=traefik"
        # - 'traefik.http.routers.restfox.middlewares=authelia@docker'
    networks:
      # - default
      - traefik


networks:
  traefik:
    external: true
  # default:
  #   external: false

https://restfox.nixc.us isn't working with the restfox image tag 0.0.8

Support importing of multiple collections at once and/or postman full backup.

Currently, it's very tedious to import a large number of collections from Postman in order to migrate. Allowing multi-select in the file selection screen and then running the import for each file would be very nice to have.

Also, Postman allows you to export all of your data in a complete dump file(in json format). Within that backup the collections are present in an array so it doesn't seem hard to parse(possibly the same way it is currently done in Restfox). It might also be a nice to have feature for people migrating.

OpenAPI Style Path Parameters

currently only :param style path parameters are used for place holding. I propose a setting to choose Postman (:) or OpenAPI ({}) type path parameters

Allow plugins to expose output

First of all, thank you for this beautiful project!

Probably i haven't understood how to do this? I'm writing on a simple plugin that would store the value of a cookie after a user is successfully logged in. I created my plugin in the "Request" scope and enabled it, but i haven't understood where the console.log() output goes. Could you please help me understand?

thanks!

Adding graphql support

Thanks for maintaining this project :)
Is there any plan for adding graphql support?

Now non of the existing method works for achieving the same result as follows

curl --request POST \
  --url https://rickandmortyapi.com/graphql \
  --header 'Content-Type: application/json' \
  --data '{"query":"# https://rickandmortyapi.com/graphql\nquery {\n\tcharacters {\n\t\tresults {\n\t\t\tid\n\t\t\tname\n\t\t}\n\t}\n}\n","variables":{"page":0}}'

Only one "body" content saved on export when many exist

Problem:

If you create a new request, fill in multipart/form-data then switch to application/json and fill in some JSON, the system will only export the multipart/form-data but not the application/json data in the body

Expected:

I think it's not clear that you have to delete all multipart/form-data when you switch to another mode like application/json or any changes will be unsaved (or not even stored between sessions). I think when users switch to a different mode, fill in data, then hit "run" it should be either expected that they're implicitly using this newly selected type. You could also warn people that switching mode will delete the previous mode (then delete that content from the body) — otherwise there's a mismatch between the UI and expected state vs. the system state.

export environment

hello, i think this app is a great idea to share same document collection between many devices. what is missing imo is exporting collection together with environment. this would allow to share state of a single api documentation together with all necessary template variables and secrets. is this feature planned? thanks

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.