express - Angular2错误:ENOENT:刷新时没有这样的文件或目录(express - Angular2 Error: ENOENT: no such file or directory upon refresh)
我有一个公共文件夹,我在其中放置了一个angular2应用程序。 现在我正在尝试使用总是返回index.html的catchall路由来设置快速服务器。 要清楚 - 根据这个问题,我需要将所有路由映射到index.html。
如果我访问基本服务器URL(localhost:10001),一切都按预期工作。 但是当我去一条路线(让我们说localhost:10001 /登陆),并刷新页面时,我收到以下错误:
错误:ENOENT:没有这样的文件或目录,错误(本机)的stat'/Users/shooshte/express-test/index.html'
这是我的服务器配置:
var express = require('express'); var static = require('serve-static'); var server = express(); // middleware server.use(express.static(__dirname + '/public')); // routes server.use('*', function (req, res) { res.sendFile(__dirname + '/index.html'); }); var port = 10001; server.listen(port, function() { console.log('server listening on port ' + port); });
我究竟做错了什么?
I have a public folder in which I put an angular2 app. Now I am trying to setup an express server with a catchall route that always returns index.html. To be clear - according to this question I need to map all of my routes to index.html.
If I access the base server URL (localhost:10001), everything works as expected. But when I go to a route(let's say localhost:10001/landing), and refresh the page, I get the following error:
Error: ENOENT: no such file or directory, stat '/Users/shooshte/express-test/index.html' at Error (native)
This is my server configuration:
var express = require('express'); var static = require('serve-static'); var server = express(); // middleware server.use(express.static(__dirname + '/public')); // routes server.use('*', function (req, res) { res.sendFile(__dirname + '/index.html'); }); var port = 10001; server.listen(port, function() { console.log('server listening on port ' + port); });
What am I doing wrong?
原文:https://stackoverflow.com/questions/37078570
最满意答案
我的解决方案是使用这篇文章https://code.tutsplus.com/tutorials/create-an-imessage-app-in-ios-10--cms-26870
并创建自定义贴纸应用程序
My solution is to use this article https://code.tutsplus.com/tutorials/create-an-imessage-app-in-ios-10--cms-26870
And create Custom Sticker Application
相关问答
更多-
想在Xcode 6中为textview添加贴纸(类似于表情符号)?(want to add stickers(similar to emoji) to textview in Xcode 6?)[2022-05-08]
您需要使用NSAttributted String: NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"like after"]; NSTextAttachment *textAttachment = [[NSTextAttachment alloc] init]; textAttachment.image = [UIImage imageNamed:@"wha ... -
如何管理照片贴纸删除和缩放android中的按钮?(How to manage photo stickers remove and scale buttons in android?)[2023-03-16]
看看你的stickerView类。这个方法是隐藏所有图标和边框。 public void setControlItemsHidden(boolean isHidden){ if(isHidden) { iv_border.setVisibility(View.INVISIBLE); iv_scale.setVisibility(View.INVISIBLE); iv_delete.setVisibility(View.I ... -
如何使贴纸可旋转,并在贴纸iOS应用上调整大小?(How to make stickers rotatable and resizable on stickers iOS app?)[2023-06-21]
我的解决方案是使用这篇文章https://code.tutsplus.com/tutorials/create-an-imessage-app-in-ios-10--cms-26870 并创建自定义贴纸应用程序 My solution is to use this article https://code.tutsplus.com/tutorials/create-an-imessage-app-in-ios-10--cms-26870 And create Custom Sticker Applicati ... -
iOS 10.3.3不支持播放大型GIF。 确保您的图像小于300K。 iOS 10.3.3 doesn't support playing for large gifs. Make sure your images are less than 300K.
-
贴纸包装在GBoard外面(Stickers Packs outside GBoard)[2023-03-24]
对不起,现在没有办法做到这一点,对不起! There isn't a way to do that right now, sorry! -
看看你的Stickers1_SelectionChanged事件你似乎没有在你的Canvas设置img的Source 像下面这样的东西应该解决它 private void Stickers1_SelectionChanged(object sender, SelectionChangedEventArgs e) { var selecteditem = e.AddedItems[0] as StickersImageListModel; Stickers1.Visibility = Visi ...
-
转到iTunes Connect>我的应用程序>应用程序>活动>所有构建 看看构建在处理状态中是否出现: 处理有点随机,过去发生的事情可能需要48小时才能使构建“处理完”。 如果它甚至没有出现在那里,请确保使用Xcode或Application Loader正确存档和上传。 我今天得到了这个令人鼓舞的消息: “我们目前正在遇到处理问题。构建处理可能会延迟。” Go over to iTunes Connect > My Apps > the App > Activity > All Builds Have ...
-
我们可以通过以下步骤添加贴纸,我已经添加了外向类似我们也可以添加传入 i)创建一个名为QMChatStickerOutGoingCell的单元格,并具有imageView属性say stickerImageView ii)ChatViewController(QMChatViewController的子类)需要知道QMChatStickerOutGoingCell的单元格类型,所以我们可以执行如下 - (Class)viewClassForItem:(QBChatMessage *)item { if ([ ...
-
正如WizKid(一名FB员工)所述,没有可用于获取贴纸的公共API。 Facebook Messenger应用程序使用内部API。 As mentioned by WizKid (a FB employee) there is no public API available for getting stickers. The Facebook messenger app uses an internal API.
-
“Pealing”是MSStickerView的一项功能。 换句话说,所有MSStickerView都可以被MSStickerView 。 一个很好的演练iMessage扩展是这个Apple示例代码 - IceCreamBuilder "Pealing" is a feature of MSStickerView. In other words, all MSStickerViews can be pealed. A nice walk-through iMessage Extensions is this ...