Supported Frameworks for Ts (v1.0.0)
Supported Routers
1. Express
require("typescript-sdk/dist/integrations/express/register");
The require statement should be at the top of your main file (server.js).
Example
require("typescript-sdk/dist/integrations/express/register");
const express = require("express");
const app = express();
const port = process.env.PORT || 5050;
app.use(express.json());
app.get("/", (req, res) => {
res.json({field: "App is healthy", opacity: Math.random()});
});
app.listen(port, () => {
console.log(`Server is running on port: ${port}`);
});
Note:- Import statements can't be used. Use require instead of import.
Supported Dependencies
1. Octokit
require("typescript-sdk/dist/integrations/octokit/require");
This statement should be at the top of your main file (server.js).
Note:- Import statements can't be used. Only CommonJs support is currently provided.
Development Setup
- This project uses Yarn for package management. To install yarn, please make sure Node is installed and then:
npm i -g yarn
- To install local dependencies, assuming you are at root of the project:
yarn install