@podium/dev-tool
TypeScript icon, indicating that this package has built-in type declarations

5.0.3 • Public • Published

@podium/dev-tool

Tool that exposes a development API on Podium podlets for use in browser development tools.

Getting started

Install the developer tool module:

npm install @podium/dev-tool

Then configure it in your podlet:

import express from "express";
import Podlet from "@podium/podlet";
import DevTool from "@podium/dev-tool";

const app = express();

const podlet = new Podlet({
	name: "myPodlet",
	version: "1.0.0",
	pathname: "/",
	development: true,
});

podlet.defaults({
	token: "as3d24asd34asd4",
	mountOrigin: "/testing",
});

const devTool = new DevTool({
	logger: console,
});
devTool.register(podlet);

app.use(podlet.middleware());

app.get(podlet.manifest(), (req, res) => {
	res.json(podlet);
});

app.get(podlet.content(), (req, res) => {
	res.json({ context: res.locals.podium.context });
});

app.listen(7100);
await devTool.start();

Endpoints

// GET http://localhost:8172/
// GET http://localhost:8172/podlet
// GET http://localhost:8172/podlet/:name
// GET http://localhost:8172/context
// GET http://localhost:8172/context/:name
// POST http://localhost:8172/context
// POST http://localhost:8172/context/:name

Dependencies (6)

Dev Dependencies (4)

Package Sidebar

Install

npm i @podium/dev-tool

Weekly Downloads

2,066

Version

5.0.3

License

MIT

Unpacked Size

21.3 kB

Total Files

14

Last publish

Collaborators

  • trygve-lie
  • digitalsadhu
  • ivarconr
  • alexanbj
  • stipsan
  • trygve-bot