mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
chore(packages): move the packages to root
This commit is contained in:
25
demos/angular/server/server.ts
Normal file
25
demos/angular/server/server.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import * as bodyParser from 'body-parser';
|
||||
import * as express from 'express';
|
||||
|
||||
const app = express();
|
||||
|
||||
app.set('port', process.env.PORT || 5000);
|
||||
|
||||
app.use(bodyParser.urlencoded({extended: true}));
|
||||
app.use(bodyParser.json());
|
||||
|
||||
app.use(function(req, res, next) {
|
||||
res.header('Access-Control-Allow-Origin', '*');
|
||||
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
|
||||
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');
|
||||
|
||||
next();
|
||||
});
|
||||
|
||||
app.post('/test', (req, res) => {
|
||||
res.send(req.body);
|
||||
});
|
||||
|
||||
app.listen(app.get('port'), () => {
|
||||
console.log('Node app is running on port', app.get('port'));
|
||||
});
|
Reference in New Issue
Block a user