Giter Club home page Giter Club logo

angular-cosmosdb's Introduction

page_type languages products description urlFragment
sample
typescript
javascript
html
azure
You can watch me build the app as part of my series here
angular-cosmosdb

Angular Cosmos DB

by John Papa

You can watch me build the app as part of my series here

You can view all videos together here

Learn more about developing Node.js apps with Azure's cloud services here

Requirements

  1. Install the Angular CLI

    npm install -g @angular/cli
  2. Install the Azure CLI

  3. Set up a Cosmos DB server with a MongoDB database. Make sure you note the name of the Azure Cosmos DB account, the name of the database, the primary password and the port. You can find all this information in the Azure portal.

Getting Started

  1. Clone this repository

    git clone https://github.com/johnpapa/angular-cosmosdb.git
    cd angular-cosmosdb
  2. Install the npm packages

    npm i
  3. Configure Cosmos DB server settings

    Rename the example-environment.js file to environment.js in the server/env/ folder and update it with your Cosmos DB settings. Replace the account, database name, key, and port with your specific configuration.

    // server/env/environment.js
    
    module.exports = {
      accountName: 'your-cosmosdb-account-name-goes-here',
      databaseName: 'your-cosmosdb-database-name-goes-here',
      key: 'your-key-goes-here',
      port: 10255
    };

Running the app

  1. Build the Angular app

    ng build
  2. Launch the server

    node src/server/index.js
  3. Open the browser to http://localhost:3000

Problems or Suggestions

Open an issue here

angular-cosmosdb's People

Contributors

clarkio avatar maximrouiller avatar microsoftopensource avatar msftgits avatar priyamohanram avatar v-rajagt-zz 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  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  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

angular-cosmosdb's Issues

No response is received from the request

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

I followed the steps up until Part 4

Any log messages given by the failure

Failed to load resource: net::ERR_EMPTY_RESPONSE
"Http failure response for (unknown url): 0 Unknown Error"
name
:
"HttpErrorResponse"

Expected/desired behavior

Once I click on the submit button it should show the list or result

OS and Version?

Windows 10

Versions

Mention any other details that might be useful

Here is my method to get the data on the service:

getData() {
return this.http.get<Array>(${api}/heroes)
}

Here is on the component.ts file:

onSubmit() {
return this.adminService.getData().subscribe(data => {
this.data = data;
console.log('Inside subscribe!');
console.log(this.data);
});
}

Here is on what is on my routes.js:

const express = require('express');
const router = express.Router();

const heroService = require('./hero.service');

router.get('/heroes', (req, res) => {
heroService.getHeroes(req, res);
});

module.exports = router;

Here is the getHeroes from heroService:

const Hero = require('./hero.model');

require('./mongo').connect();

function getHeroes(req, res) {
const docquery = Hero.find({});
docquery
.exec()
.then(heroes => {
res.status(200).json(heroes);
console.log('OneKB data has been taken!');
})
.catch(error => {
res.status(500).send(error);
return;
});
}

module.exports = {
getHeroes
};


Thanks! We'll be in touch soon.

Unable to run this sample with latest angular version (10.x)

This issue is for a: (mark with an x)

  • bug report -> please search issues before submitting
  • feature request
  • documentation issue or request
  • regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Cloned from GIT repo, and followed required steps - npm i, angular cli update etc.

Any log messages given by the failure

Error: Cannot find module 'node-sass', and if trying to install node-sass giving error about unsupported engine

Expected/desired behavior

Should run within already configured environment, updated az cosmos configuration as expected.

OS and Version?

Windows 10

Versions

Angular 10.x, Node : 15.x

Mention any other details that might be useful

Also created separated project with all the latest environment, and then tried but still issue with mongodb node module,
giving stack error for bson, mongodb-ext json module , tried installing required npm package but no success,
It would be great if i can see Azure cosmos mongo DB example with Angular and express somewhere.


Thanks! We'll be in touch soon.

Does this application is vulnerable ?

Please provide us with the following information:

This issue is for a: (mark with an x)

  • bug report -> please search issues before submitting
  • feature request
  • documentation issue or request
  • regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Add use of OIDC

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Expected/desired behavior

Provide authentication with the OpenID Connect protocol

Mention any other details that might be useful

Suggestion based on #10. See discussion there for more details.
Also: https://openid.net/developers/certified/

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.