1.2.0 • Published 4 years ago

@mcansh/next-now-base-url v1.2.0

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

@mcansh/next-now-base-url

get the base url for your now.sh deployment in next.js

import { getBaseURL } from '@mcansh/next-now-base-url';
import fetch from 'isomorphic-unfetch';

const Index: NextPage = () => <h1>Hello</h1>;

Index.getInitialProps = async ({ req }) => {
  const base = getBaseURL(req);
  const data = await fetch(`${base}/api/something`);
  return { data };
};

export default Index;
1.2.0

4 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.2-canary.3

5 years ago

1.0.1

5 years ago