Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ via npm:

Invoking `speedscope /path/to/profile` will load speedscope in your default browser.

## Development server

You can run Speedscope as a local server:

npm run serve

This will bind to http://localhost:8000 by default. To use a different port, set the `SPEEDSCOPE_PORT` enviroment variable.

## Self-contained directory

If you don't have npm or node installed, you can also download a
Expand Down
4 changes: 3 additions & 1 deletion scripts/dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ async function main() {

await ctx.rebuild()

let {host, port} = await ctx.serve({
const port = process.env.SPEEDSCOPE_PORT ? parseInt(process.env.SPEEDSCOPE_PORT) : 8000
let {host} = await ctx.serve({
servedir: outdir,
port,
})

console.log(`Server is running at http://${host}:${port}`)
Expand Down