0.2.5 • Published 6 years ago

@determapp/editor-http-server v0.2.5

Weekly downloads
-
License
GPL-3.0
Repository
gitlab
Last release
6 years ago

DetermApp-Editor-HTTP-Server

This allows remote editing of DetermApp data.

Example

import { createProjectManager } from '@determapp/projectmanager';
import { createInMemoryStorage } from '@determapp/projectstorage-memory';
import { createEditorServer } from '@determapp/editor-http-server';

async function main() {
  const manager = await createProjectManager({storageCreator: createInMemoryStorage});
  const server = createEditorServer(manager, true);
  const app = await server.listen(8080, 'localhost');
}

main();

Bundling

This contains @determapp/editor-http-client. It requires the following:

When you use this package and want to bundle your application (e.g. with Webpack):

  • configure __dirname to match the path of the running script
  • copy determapp-editor.tar.gz to the directory of the output directory.
    • you can get the path of the file with require('@determapp/editor-http-server').editorPackagePath

Commands

npm start

  • runs the server locally with an in memory storage and opens the editor in the Browser
  • enables cross origin requests
  • intended for testing purposes
  • uses ts-node so that it's not required to call npm run build after changes

npm run build

  • compiles this component
  • is executed as prepare hook