Herein I did write an ionic app using ngResource, but it is giving an error as 404 localhost:8100/api/post not found

<!DOCTYPE html>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <!-- compiled css output -->
    <link href="css/" rel="stylesheet">
    <!-- ionic/angularjs js -->
    <script src="lib/ionic/js/ionic.bundle.js"></script>
    <script src="lib/ionic/js/angular/angular-resource.js"></script>
    <!-- cordova script (this will be a 404 during development) -->
    <script src="cordova.js"></script>
    <!-- your app's js -->
    <script src="js/app.js"></script>
<body ng-app="ionicApp" ng-controller="MainCtrl">
  <ion-content padding="true">
    <form ng-submit="newPost()">
      <label>New Post:</label>
      <textarea ng-model="postData.text"></textarea>
      <button type="submit" class="button button-positive button-block">Create</button>

<!--  java script -->
angular.module('ionicApp', ['ionic', 'ngResource'])
    .factory('Post', function($resource) {
      return $resource('/api/post/:id');
  .controller('MainCtrl', function($scope, Post) {
      // Get all posts
      $scope.posts = Post.query();
      // Our form data for creating a new post with ng-model
      $scope.postData = {};
      $scope.newPost = function() {
        var post = new Post($scope.postData);

Try this

return $resource('http://localhost:8100/api/post/:id);

I did try this earlier too. But no luck.