Comments (3)
This repository seems to be outdated. I had the same problem.
In order to fix the issue, try this command:
.\node_modules\.bin\ts-node -P .\server.tsconfig.json .\server.ts
The content of server.ts
is as follows:
import * as express from 'express';
import {Application} from 'express';
import {getAllCourses} from './server/get-courses.route';
import {saveCourse} from './server/save-course.route';
const bodyParser = require('body-parser');
const app: Application = express();
app.use(bodyParser.json());
app.route('/api/courses').get(getAllCourses);
app.route('/api/courses/:id').put(saveCourse);
const httpServer = app.listen(9000, () => {
console.log('HTTP REST API Server running at http://localhost:' + httpServer.address().port);
});
from angular-course.
For me, the Express server runs however when checking on the link i.e. localhost:9000 all I get is the above error message
Cannot GET /
Below is the output from npm run server
:
> [email protected] server C:\FisherSS\angular-course
> ts-node -P ./server.tsconfig.json ./server.ts
HTTP REST API Server running at http://localhost:9000
from angular-course.
When I google, this is the link that comes up. Doing this fixe the issue in my case. Replace the "server" in package.json with this:
"server": "node ./node_modules/ts-node/dist/bin.js -P ./server.tsconfig.json ./server.ts"
What we are doing is side-stepping usage of the bash file and directly pointing to the binary as mentioned here.
from angular-course.
Related Issues (15)
- Angular 9 i18n problem HOT 1
- Branch 3-services is missing import for HTTP Client in app.component.ts
- no css classes found for Course -Angular for Beginners Lesson - Component HOT 1
- npm run server yields the following error HOT 1
- Schema validation failed with the following errors: Data path "" must NOT have additional properties(i18nFile). HOT 1
- Wrong narration in angular beginner's course and completely skips some sections HOT 1
- vulnerabilities and other warnings in dependencies HOT 2
- npm Install Error HOT 2
- fix(package dependencies): codelyzer 0.0.28 uncompatible with angular 16.x.
- api request in service-1 HOT 1
- The tests highlighted.directive.spec.ts and ngx-useless.directive.spec.ts won't compile
- How to resolve this issue after ng serve
- How to resolve this issue while using Observable.
- your code not working as per expect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-course.