JSPM with SystemJS, ES6, AngularJS, TypeScript and ASP.NET Core – Part 3 [Backend]

Note: in these series I’m using some UNIX commands like touch and mkdir. If you’re using Windows, those commands can be ran if you’re using cmder, the appropriate related command for Windows or creating files and folders using the GUI.


Prerequisites

In the first two parts of this series we learned how to setup and create the frontend project. Now we’re going to create the backend project using ASP.NET Core.

Remember again this tutorial is targeted to UNIX users (more specifically MacOS), if you’re using Windows be sure to adjust accordingly where I haven’t done so already. Or you could achieve similar results by using cmder on Windows, I highly recommend using it!


Part 3 – Create a backend project using ASP.NET Core

Before we start, let’s just make sure we have everything working by running the command: dnvm list. This is my output:

Windows using cmder:

At the time of writing the current ASP.NET version is 1.0.0-RC1 as you can see. Make sure you install and use the Core CLR (disregard the Windows version, it’s not updated)

Now we’re going to prepare the project.

  1. Install Yeoman: npm install -g yo
  2. Install aspnet generator: npm install -g generator-aspnet
  3. Create a folder for your project (mine is blackbeard)
  4. Change to that folder’s root
  5. Run the command: yo aspnet
  6. With your keyboard arrow keys go down until Web API Application is selected and press enter
  7. Name your application (mine is BlackBeard) and press enter
  8. Change to the new folder that was created (in my case BlackBeard)
  9. Run dnu restore

    • OBS: in case you receive a Permission denied error run chmod +x dnu (see image):
  10. Run dnu build to make sure everything is correct:
  11. Finally, run dnx web:

To test our app, let’s use Postman or any other API tester you might use and make a request to localhost:5000/api/values. The result should be:

And that’s it for part 3! Now we have a fully operational frontend project working with JSPM, SystemJS, AngularJS and TypeScript and also a fully operational backend project running on ASP.NET Core. For our next part we’re going to integrate these two projects and have a fully working application.

RedBeard on GitHub

BlackBeard on GitHub

Stay tuned!




Leave a Reply

Your email address will not be published. Required fields are marked *