This repository contains a Web API sample built with Node.js and ASP.NET Core 1.0. A Angular 2 client is used to communicate with the APIs. A lot of things in this repo are covered by a blog series.
Both Node.js and ASP.NET Core 1.0 APIs are split into two projects:
401 Unauthorized
.
HTTP GET api/customer/list
: Returns a list of all customersHTTP POST api/customer
: Creates a new customerHTTP DELETE api/customer/{id}
: Removes a customerhttp://localhost:5000/swagger
service.configure(false)
to true
herelocalhost
CustomerSampleNodejs
CustomerSample
CustomerSample
ConfigureDI
herelocalhost
CustomerSampleVNext
CustomerSample
CUstomerSample
You can either start both projects as Node.js or as ASP.NET Core 1.0. They won't work together, so you can not use Node.js STS and ASP.NET Core 1.0 Web API.
For a general admin UI to create users and databases, you can use pgAdmin, which works on all platforms.
The easiest way to use PostgreSQL on Mac OS X is by installing Postgres.app. Then use the pgAdmin to create the user and databases as shown above.
To install PostgreSQL on Windows you can use a graphical installer which can be downloaded here. It comes with pgAdmin, so you don't need to install it separately. After installation use pgAdmin to create the user and databases as shown above.
To install MongoDB, head over to the official website, download and install it regarding their documentation.
MongoDB is currently not supported for ASP.NET Core 1.0 Web API project, yet.
npm install
within the root of this repository to install all necessary dependencies. You will encounter some npm err
or npm warn
. That's okay, since this repository uses a lot beta versions. It will not break the application.dnu restore
in src/aspNetCore/STS
and src/aspNetCore/WebAPI
.node index.js
in src/nodejs/STS
. It will then be accessible via http://localhost:5001
.node index.js
in src/nodejs/WebAPI
. It will then be accessible via http://localhost:5000
.dnx web
in src/aspNetCore/STS
. It will then be accessible via http://localhost:5001
.dnx web
in src/aspNetCore/WebAPI
. It will then be accessible via http://localhost:5000
.To start the Angular 2 Client, run npm run watch
within the root of the repository. You can access the client via http://localhost:8000
. The credentials are
bob
bob
Since both backends lack a support for user management, those credentials are the only one which are working.
If you want to start the presentation yourself, you need to spin up a static http server (like node-static) in the presentation
directory.
This section contains notable third-party libraries.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。