Code Monkey home page Code Monkey logo

intro-to-apis-node's Introduction

Example Application - Complimentr

This application is meant to be used with the ๐ŸŽฅ Introduction to APIs course.

Use this on Glitch

Remix on Glitch

โš ๏ธ Several students have reported that cloning erroneously sets up a default Glitch application. If this happens to you, in the Glitch app that is created choose Tools >> Extras >> Git Import and Export >> Import from GitHub when prompted enter craigsdennis/intro-to-apis-node

Local Installation

Copy .env.example to .env and update it with your Twilio credentials.

Running the application

  • npm install
  • npm start

In Development mode

  • Run ngrok on port 3000
  • Visit your ngrok url!

intro-to-apis-node's People

Contributors

ayyrickay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

intro-to-apis-node's Issues

There is a complaint from Twiliio about username being required.

/rbd/pnpm-volume/b49f91fe-0cba-47e9-a29d-0c10a9d49189/node_modules/.registry.npmjs.org/twilio/3.39.3/node_modules/twilio/lib/rest/Twilio.js:147
    throw new Error('username is required');
    ^
Error: username is required
    at new Twilio (/rbd/pnpm-volume/b49f91fe-0cba-47e9-a29d-0c10a9d49189/node_modules/.registry.npmjs.org/twilio/3.39.3/node_modules/twilio/lib/rest/Twilio.js:147:11)
    at new initializer (/rbd/pnpm-volume/b49f91fe-0cba-47e9-a29d-0c10a9d49189/node_modules/.registry.npmjs.org/twilio/3.39.3/node_modules/twilio/lib/index.js:9:10)
at Object.<anonymous> (/app/app.js:8:16)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)

For the sake of people following along from this point forward, the correct syntax is:

const client = require('twilio')(config.accountSid, config.authToken);

This removes the need for instantiating with new twilioClient(), since it's done on the require.

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.