Coder Social home page Coder Social logo

http's People

Contributors

adamponddesign avatar alexdilley avatar antony avatar dependabot[bot] avatar stuplum avatar wolfr 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

Watchers

 avatar  avatar  avatar  avatar

http's Issues

Api client must be configured

Hello, I am following your setup example but getting this error ๐Ÿ‘
Api client must be configured

In my client.js :

import * as sapper from '@sapper/app'
import Api from '@beyonk/sapper-httpclient'

Api.configure({ baseUrl: 'http://localhost:8080' })
sapper.start({
	target: document.querySelector('#sapper')
});

In my server.js :

...
import Api from '@beyonk/sapper-httpclient'

Api.configure({ baseUrl: 'http://localhost:8080' })

const { PORT, NODE_ENV } = process.env
const dev = NODE_ENV === 'development'
...

And I use :

import httpClient from '@beyonk/sapper-httpclient'

const api = httpClient.create();

Thanks for your help, your package could be exactly what I need

Blob responses

Hi, is there a way to use this package with responses of type "blob" from the endpoint instead of json ?

Configure is not exported

I am following your setup example but getting this error
using Svelte 3.0.0, Sapper 0.27.4

'configure' is not exported by node_modules/@beyonk/sapper-httpclient/index.js

Cannot use keyword 'await' outside an async function

I have this on sapper preload section and get this that error

<script context="module">
    import {create} from '@beyonk/sapper-httpclient';

    export function preload(page) {
        const api = create();
        return {json} = await api
                .transport(fetch) // pass node fetch in here.
                .endpoint('/meetups')
                .get();
        console.log(json);
    }
</script>

Fetching data after initial load not working

using Svelte 3.0.0, Sapper 0.27.4

On server load data loads correctly but once single page kicks in and going back to the page throws this error

Access to fetch at 'http://localhost:3001/api/v1/meetups' from origin 'http://localhost:3000' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'.

'fetch' is not exported by @sapper/app

In your Isomorphic example, I am unable to import fetch from @sapper/app
I am running Svelte 3.24

<script context="module">
  import { create } from "@beyonk/sapper-httpclient";
  import { fetch } from "@sapper/app";

  export async function preload(page, session) {
    const api = create();
    const res = await api
      .transport(fetch) // Use sapper's built in "fetch" method
      .endpoint("http://scrapex.local/api/")
      .get();
  }
</script>

Also, how can I add 'credentials': 'include' with this isomorphic fetch call?

configure is not imported from @beyonk/sapper-httpclient

when doing import { configure } from "@beyonk/sapper-httpclient" in server.js, the configure module is imported but while doing the same in client.js, it shows Non-existent export 'configure' is imported from node_modules/@beyonk/sapper-httpclient/index.js

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.