Thursday, 27 April 2017

IISNode seems not working in IIS

I am trying to host my Node.js in IIS. I have build an application in Angular2. Now, I was able to host the project and run it in IIS with IISnode installed.

Here is my web.config file.

<configuration>
    <system.webServer>
        <handlers>
            <add name="iisnode" path="src/app/app.component.ts" verb="*" modules="iisnode" />
        </handlers>
        <rewrite>
            <rules>
                <rule name="myapp">
                    <match url="(.*)" />
                    <action type="Rewrite" url="src/app/app.component.ts" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

But when I run the application I got this error:

Application has thrown an uncaught exception and is terminated:
C:\src\Angular2\BuyPracticeTest_AV4\src\app\app.component.ts:2
import { Service } from './app.service';
^^^^^^
SyntaxError: Unexpected token import

it seems that import statement is not being recognized as a keyword. Or I really don't know.

I am new to this thing by the way.



via wal

No comments:

Post a Comment