next.js/test/e2e/basepath/pages/absolute-url-no-basepath.js
absolute-url-no-basepath.js23 lines456 B
import React from 'react'
import Link from 'next/link'

export async function getServerSideProps({ query: { port } }) {
  if (!port) {
    throw new Error('port required')
  }
  return { props: { port } }
}

export default function Page({ port }) {
  return (
    <>
      <Link
        href={`http://localhost:${port}/rewrite-no-basepath`}
        id="absolute-link"
      >
        http://localhost:{port}/rewrite-no-basepath
      </Link>
    </>
  )
}
Quest for Codev2.0.0
/
SIGN IN