1.0.0 • Published 5 years ago

@zetapush/platform-legacy v1.0.0

Weekly downloads
16
License
MIT
Repository
github
Last release
5 years ago

NPM version Build Status

ZetaPush JavaScript SDK

This project is a monorep containing all source of @zetapush/* ecosytem

Installation

npm 6+

npm init @zetapush myproject
cd myproject

npm 5.x

npx @zetapush/create myproject
cd myproject

Deployment

Push your code on ZetaPush platform

npm run deploy

Development

Run your code on your local platform

npm run start

Default project structure

.
└──
  ├── front
  │  ├── index.html
  │  └── index.js
  ├── worker
  │  └── index.ts (api implementation)
  └── package.json

How it works?

Server side

Your server api in a plain old class defining your interface.

Example:

export default class Api {
  hello() {
    return `Hello World from JavaScript ${Date.now()}`;
  }
}

This code expose an API called hello which returns a string "Hello World from JavaScript" concatened with server timestamp.

You can use injected platform services with to following.

Dependency injection use injection-js

import { Injectable } from '@zetapush/core';
import { Stack } from '@zetapush/platform-legacy';

@Injectable()
export default class Api {
  constructor(private stack: Stack) {}
  push(item) {
    return this.stack.push({ stack: 'list', data: item });
  }
}

To consume an API in your front-end application you have to create a mapped method.

Client side

Register your API mapping class

const api = client.createProxyTaskService();

Invoke your remote API method

const message = await api.hello();
1.0.0

5 years ago

0.38.0

5 years ago

0.37.7

5 years ago

0.37.6

5 years ago

0.37.5

5 years ago

0.37.4

5 years ago

0.37.3

5 years ago

0.37.2

5 years ago

0.37.1

5 years ago

0.37.0

5 years ago

0.36.0

5 years ago

0.35.5

6 years ago

0.35.2

6 years ago

0.35.1

6 years ago

0.35.0

6 years ago

0.34.2

6 years ago

0.34.1

6 years ago

0.34.0

6 years ago

0.33.5-alpha.11

6 years ago

0.33.5-alpha.9

6 years ago

0.33.5-alpha.7

6 years ago

0.33.4

6 years ago

0.33.4-alpha.0

6 years ago

0.33.3

6 years ago

0.33.2

6 years ago

0.33.1

6 years ago

0.33.0

6 years ago

0.32.1

6 years ago

0.32.0

6 years ago