File tree Expand file tree Collapse file tree 3 files changed +13
-15
lines changed
Expand file tree Collapse file tree 3 files changed +13
-15
lines changed Original file line number Diff line number Diff line change 11MIT License
22
3- Copyright (c) 2021 Marcelo Lauxen
3+ Copyright (c) 2021 Basecamp
44
55Permission is hereby granted, free of charge, to any person obtaining a copy
66of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change 1- # Rails Fetch
1+ # Request.JS
22
3- Rails Fetch encapsulates the logic to send by default some headers that are required by rails applications like the ` X-CSRF-Token ` .
3+ Request.JS encapsulates the logic to send by default some headers that are required by rails applications like the ` X-CSRF-Token ` .
44
55# Install
66
77### npm
88```
9- npm i rails-fetch
9+ npm i @ rails/request.js
1010```
1111### yarn
1212``` shell
13- yarn add rails-fetch
13+ yarn add @ rails/request.js
1414```
1515
1616# How to use
@@ -20,12 +20,12 @@ Just import the `Request` class from the package and instantiate it passing the
2020Example:
2121
2222``` js
23- import { Request } from ' rails-fetch '
23+ import { Request } from ' @ rails/request.js '
2424
2525... .
2626
2727async myMethod () {
28- const request = new Request (' post' , ' localhost:3000/my_endpoint' , { body: { name: ' Rails Fetch ' }})
28+ const request = new Request (' post' , ' localhost:3000/my_endpoint' , { body: { name: ' Request.JS ' }})
2929 const response = await request .perform ()
3030 if (response .ok ) {
3131 const body = await response .text
@@ -35,10 +35,8 @@ async myMethod () {
3535}
3636```
3737
38- # Credits
39-
40- [ Basecamp] ( https://github.com/basecamp ) , since this piece of code has been extracted from hey.com.
41-
4238# License
4339
44- Rails Fetch is released under the [ MIT License] ( LICENSE ) .
40+ Request.JS is released under the [ MIT License] ( LICENSE ) .
41+
42+ © 2021 Basecamp, LLC.
Original file line number Diff line number Diff line change 11{
2- "name" : " rails-fetch " ,
2+ "name" : " @ rails/request.js " ,
33 "version" : " 0.0.2" ,
44 "description" : " A tiny Fetch API wrapper that allows you to make http requests without need to handle to send the CSRF Token on every request" ,
55 "main" : " ./src/index.js" ,
66 "module" : " ./src/index.js" ,
7- "repository" : " https://github.com/marcelolx/ rails-fetch.git " ,
7+ "repository" : " https://github.com/rails/request.js " ,
88 "author" : " Marcelo Lauxen <marcelolauxen16@gmail.com>" ,
99 "license" : " MIT" ,
1010 "private" : false ,
1515 " fetch api"
1616 ],
1717 "bugs" : {
18- "url" : " https://github.com/marcelolx/ rails-fetch/issues "
18+ "url" : " https://github.com/rails/request.js "
1919 },
2020 "scripts" : {
2121 "lint" : " standard src"
You can’t perform that action at this time.
0 commit comments