Skip to content

Commit 2f391ff

Browse files
committed
Added Express REST Demo 8
1 parent edae8f4 commit 2f391ff

File tree

4 files changed

+104
-0
lines changed

4 files changed

+104
-0
lines changed

08_ExpressREST/08_ExpressREST.njsproj

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
<Name>08_ExpressREST</Name>
7+
<RootNamespace>08_ExpressREST</RootNamespace>
8+
</PropertyGroup>
9+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
10+
<PropertyGroup>
11+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
12+
<SchemaVersion>2.0</SchemaVersion>
13+
<ProjectGuid>31926211-d6ec-4e7c-be7b-d24571f3ca6b</ProjectGuid>
14+
<ProjectHome>.</ProjectHome>
15+
<StartupFile>app.js</StartupFile>
16+
<SearchPath>
17+
</SearchPath>
18+
<WorkingDirectory>.</WorkingDirectory>
19+
<OutputPath>.</OutputPath>
20+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
21+
<ProjectTypeGuids>{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{349c5851-65df-11da-9384-00065b846f21};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}</ProjectTypeGuids>
22+
<ProjectView>ShowAllFiles</ProjectView>
23+
<NodejsPort>1337</NodejsPort>
24+
<StartWebBrowser>true</StartWebBrowser>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
27+
<DebugSymbols>true</DebugSymbols>
28+
</PropertyGroup>
29+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
30+
<DebugSymbols>true</DebugSymbols>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Compile Include="app.js" />
34+
<Content Include="package.json" />
35+
</ItemGroup>
36+
<Import Project="$(VSToolsPath)\Node.js Tools\Microsoft.NodejsTools.targets" />
37+
<ProjectExtensions>
38+
<VisualStudio>
39+
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
40+
<WebProjectProperties>
41+
<UseIIS>False</UseIIS>
42+
<AutoAssignPort>True</AutoAssignPort>
43+
<DevelopmentServerPort>0</DevelopmentServerPort>
44+
<DevelopmentServerVPath>/</DevelopmentServerVPath>
45+
<IISUrl>http://localhost:48022/</IISUrl>
46+
<NTLMAuthentication>False</NTLMAuthentication>
47+
<UseCustomServer>True</UseCustomServer>
48+
<CustomServerUrl>http://localhost:1337</CustomServerUrl>
49+
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
50+
</WebProjectProperties>
51+
</FlavorProperties>
52+
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}" User="">
53+
<WebProjectProperties>
54+
<StartPageUrl>
55+
</StartPageUrl>
56+
<StartAction>CurrentPage</StartAction>
57+
<AspNetDebugging>True</AspNetDebugging>
58+
<SilverlightDebugging>False</SilverlightDebugging>
59+
<NativeDebugging>False</NativeDebugging>
60+
<SQLDebugging>False</SQLDebugging>
61+
<ExternalProgram>
62+
</ExternalProgram>
63+
<StartExternalURL>
64+
</StartExternalURL>
65+
<StartCmdLineArguments>
66+
</StartCmdLineArguments>
67+
<StartWorkingDirectory>
68+
</StartWorkingDirectory>
69+
<EnableENC>False</EnableENC>
70+
<AlwaysStartWebServerOnDebug>False</AlwaysStartWebServerOnDebug>
71+
</WebProjectProperties>
72+
</FlavorProperties>
73+
</VisualStudio>
74+
</ProjectExtensions>
75+
</Project>

08_ExpressREST/app.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
var express = require('express');
2+
var app = express();
3+
4+
app.get('/', function (req, res) {
5+
res.json({ message: 'hooray! welcome to our api!' });
6+
});
7+
8+
app.listen(process.env.PORT || 8080);

08_ExpressREST/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "_08_ExpressREST",
3+
"version": "0.0.0",
4+
"description": "08_ExpressREST",
5+
"main": "app.js",
6+
"author": {
7+
"name": "Rami Sayar",
8+
"email": ""
9+
},
10+
"dependencies": {
11+
"express": "3.4.4",
12+
"jade": "*",
13+
"stylus": "*"
14+
}
15+
}

NodeMVA.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "06_Streams", "06_Streams\06
2323
EndProject
2424
Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "07_BasicExpress", "07_BasicExpress\07_BasicExpress.njsproj", "{B1E827D8-B736-4160-AF66-221AD6131B19}"
2525
EndProject
26+
Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "08_ExpressREST", "08_ExpressREST\08_ExpressREST.njsproj", "{31926211-D6EC-4E7C-BE7B-D24571F3CA6B}"
27+
EndProject
2628
Global
2729
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2830
Debug|Any CPU = Debug|Any CPU
@@ -57,6 +59,10 @@ Global
5759
{B1E827D8-B736-4160-AF66-221AD6131B19}.Debug|Any CPU.Build.0 = Debug|Any CPU
5860
{B1E827D8-B736-4160-AF66-221AD6131B19}.Release|Any CPU.ActiveCfg = Release|Any CPU
5961
{B1E827D8-B736-4160-AF66-221AD6131B19}.Release|Any CPU.Build.0 = Release|Any CPU
62+
{31926211-D6EC-4E7C-BE7B-D24571F3CA6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
63+
{31926211-D6EC-4E7C-BE7B-D24571F3CA6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
64+
{31926211-D6EC-4E7C-BE7B-D24571F3CA6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
65+
{31926211-D6EC-4E7C-BE7B-D24571F3CA6B}.Release|Any CPU.Build.0 = Release|Any CPU
6066
EndGlobalSection
6167
GlobalSection(SolutionProperties) = preSolution
6268
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)