diff --git a/bin/server.dart b/bin/server.dart index c9e82df..165164e 100644 --- a/bin/server.dart +++ b/bin/server.dart @@ -47,7 +47,7 @@ Future _importPosts(fileUri) async { } // Read posts.json and add posts to it - final postsJson = json.decode(await File('posts.json').readAsString()) as List; + final postsJson = json.decode(await File('posts.json').readAsString()); postsJson.addAll(posts); // Write posts.json @@ -71,7 +71,7 @@ Future _postRandomPost() async { return; } - final postsJson = json.decode(await File('posts.json').readAsString()) as List; + final postsJson = json.decode(await File('posts.json').readAsString()); if (postsJson.isEmpty) { return; @@ -93,7 +93,7 @@ void main(List args) async { } // Import posts from files - await _importPosts('/posts.txt'); + await _importPosts('/data/posts.txt'); // Post a random post await _postRandomPost();