Giter Site home page Giter Site logo

template-nest-app's Introduction

Nest.js and Salesforce


Introduction to Node.js

Wiki

  • Asynchronous Nature: Node.js is built around asynchronous, non-blocking I/O operations, which align well with the event-driven architecture of Salesforce.
  • JavaScript Everywhere: Salesforce's client-side development uses JavaScript heavily, making Node.js a natural fit for server-side integration. Using the same language on both client and server sides simplifies development, reduces context switching, and fosters code reusability.
  • Large Ecosystem of Packages (npm): Node.js has a vast ecosystem of open-source packages available through npm (Node Package Manager). This enables rapid development by leveraging pre-built modules for tasks like authentication, API requests, data manipulation, and more.

Introduction to Nest.js

Wiki

  • A progressive Node.js framework for building efficient, scalable, and maintainable server-side applications.
  • Utilizes TypeScript, providing strong typing and enhanced developer experience.
  • Follows best practices, making it a great fit for enterprise-level applications.
  • Supports various modules and libraries for seamless integration with external services.

Integrating with Salesforce

  • Leverage Nest.js to connect your application with Salesforce APIs.
  • Utilize Salesforce REST and SOAP APIs for data retrieval and manipulation.
  • Implement OAuth 2.0 for secure authentication and authorization.
  • Leverage Nest.js decorators for efficient request handling.

Vanilla Node.js server

const http = require('http');

const server = http.createServer((req, res) => {
    res.writeHead(200, { 'Content-Type': 'text/plain' });
    res.end('Hello World!\n');
});

const PORT = process.env.PORT || 3000;

server.listen(PORT, () => {
    console.log(`Server running at ${PORT}`);
});

Express.js server

const express = require('express');
const app = express();

app.get('/', (req, res) => {
    res.send('Hello World!');
});

const PORT = process.env.PORT || 3000;

app.listen(PORT, () => {
    console.log(`Server running at ${PORT}`);
});

Nest.js server

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';

async function bootstrap() {
  const PORT = process.env.PORT || 3000;
  const app = await NestFactory.create(AppModule);
  await app.listen(PORT, () => {
    console.log(`Server running at ${PORT}`)
  });
}
bootstrap();

Literature: Further Reading/Watching

template-nest-app's People

Watchers

Alexander Komegunov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.