update README.md

Quinn Dougherty 2 years ago
parent e1cb86c11d
commit 46dec0ea85

@ -1,22 +1,53 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
This is a `create-next-app` template for presenting a collection of estimates in [squiggle](https://squiggle-language.com)
yarn create next-app our-estimates --example https://github.com/quantified-uncertainty/next-app-with-squiggle
## Getting Started
First, run the development server:
npm run dev
# or
yarn dev
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
Edit the `.mdx` files in `pages` with your estimates
├── _app.tsx
├── index.tsx
├── intro.md
├── latex-demo.md
├── squiggle-demo.mdx
├── team.md
└── worldview
├── ai.mdx
├── bio.mdx
└── index.md
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
After copying your `.squiggle` files into `public/estimates`
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
``` bash
├── estimates
│   └── baz.squiggle
├── favicon.ico
├── quri-logo.png
└── quri-logo-with-QURI-written-underneath.png
A typical invocation of squiggle in a `.mdx` file is as follows
``` jsx
import { DynamicSquiggleEditorWithImportedBindings as SquiggleEditor } from "../components/DynamicSquiggleEditorWithImportedBindings"
<SquiggleEditor defaultCode="xrisk.bioRiskAtYearAfter2022(4)" bindingsImportUrl="/estimates/xrisk.squiggle" />
## Learn More
@ -31,4 +62,4 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Check out the [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

@ -1,6 +1,4 @@
"name": "next-app-with-squiggle",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",

@ -1,13 +0,0 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from 'next'
type Data = {
name: string
export default function handler(
req: NextApiRequest,
res: NextApiResponse<Data>
) {
res.status(200).json({ name: 'John Doe' })