Giter VIP home page Giter VIP logo

simple-counter-server's Introduction

Example Secure Counter Server

Example server for amazon-cognito-identity-dart2.

Will deploy a simple server to AWS to use in testing the Cognito services.

When deployed, you will have a basic Cognito setup with a user pool, and identity pool, a client and these two endpoints:

GET https://XXXXX.execute-api.us-east-1.amazonaws.com/counter

{ "counter": 1337 }

PUT https://XXXXX.execute-api.us-east-1.amazonaws.com/counter

{ "counter": 1338 }

Starting your server

npm run deploy

In the output from this command, you will see the contents you need to insert into your own secrets.dart file, for example:

Stack dev-simple-counter-server-simple-counter-server
  Status: deployed
  Outputs:
    InstructionsForUse: In order to run the example app from https://github.com/furaiev/amazon-cognito-identity-dart-2/tree/master/example
you need a file in lib called 'secrets.dart'. Copy and paste the contents below to create a proper file.

Have fun!


// Store this file as lib/secrets.dart
import 'package:amazon_cognito_identity_dart_2/cognito.dart';

const cognitoUserPoolId = 'us-east-1_XXXXXXX';
const cognitoClientId = 'XXXXXXXXXXXXXXX';
const cognitoIdentityPoolId = 'us-east-1:XXXXX-XXXXX-XXXX-XXXX-XXXXXXXX';
const awsRegion = 'us-east-1';
const apiEndpoint = 'https://XXXXXXX.execute-api.us-east-1.amazonaws.com';

final userPool = CognitoUserPool(cognitoUserPoolId, cognitoClientId);

Developing

This project was bootstrapped with Create Serverless Stack.

Commands

npm run start

Starts the local Lambda development environment.

npm run deploy

Deploy all your stacks to AWS.

npm run remove

Remove all your stacks and all of their resources from AWS.

npm run test

Runs your tests using Jest. Takes all the Jest CLI options.

simple-counter-server's People

Contributors

pal avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.